Skip to content

Commit

Permalink
ls-files: require worktree when --deleted is given
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Mar 22, 2009
1 parent 7ad3c52 commit 67c176f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
}
if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
show_deleted = 1;
require_work_tree = 1;
continue;
}
if (!strcmp(arg, "-m") || !strcmp(arg, "--modified")) {
Expand Down

0 comments on commit 67c176f

Please sign in to comment.