ls-files: require worktree when --deleted is given
authorJeff King <peff@peff.net>
Tue, 17 Mar 2009 09:03:19 +0000 (05:03 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Mar 2009 06:19:27 +0000 (23:19 -0700)
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>
builtin-ls-files.c

index 9dec282fba6ba22e37d13bdc5e35fa4a031433b5..ca6f33d0466572863db7dbd4c3079dcb06caa4e0 100644 (file)
@@ -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")) {