ls-files: require worktree when --deleted is given
The code will end up calling lstat() to check whether the file still exists; obviously this doesn't work if we're not in the worktree. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
fcfdf797db
commit
8ad3dae3a7
|
@ -419,6 +419,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
|
if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
|
||||||
show_deleted = 1;
|
show_deleted = 1;
|
||||||
|
require_work_tree = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, "-m") || !strcmp(arg, "--modified")) {
|
if (!strcmp(arg, "-m") || !strcmp(arg, "--modified")) {
|
||||||
|
|
Loading…
Reference in New Issue