summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2009-03-17 05:03:19 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-03-17 15:12:40 -0700
commit8ad3dae3a76ee42983da89ea9b5d9a4688f58f93 (patch)
treed35b58c4f4fcfd92bef61c4ad91455ce0b099a01
parentgit-branch.txt: document -f correctly (diff)
downloadtgif-8ad3dae3a76ee42983da89ea9b5d9a4688f58f93.tar.xz
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>
-rw-r--r--builtin-ls-files.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 9dec282fba..ca6f33d046 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -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")) {