@matheusbsbs / matheus-bagliano / commits / 67c176f549
Fork 0

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>

Jeff King committed Mar 17, 2009 at 05:03 UTC 67c176f549daf5530cabbb801de2b5feb0db82f4
1 file changed +1
builtin-ls-files.c
+1
@@ -419,6 +419,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
419 }
420 if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
421 show_deleted = 1;
422 + require_work_tree = 1;
423 continue;
424 }
425 if (!strcmp(arg, "-m") || !strcmp(arg, "--modified")) {