Skip to content

Commit 67c176f

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7ad3c52 commit 67c176f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin-ls-files.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
419419
}
420420
if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
421421
show_deleted = 1;
422+
require_work_tree = 1;
422423
continue;
423424
}
424425
if (!strcmp(arg, "-m") || !strcmp(arg, "--modified")) {

0 commit comments

Comments
 (0)