summaryrefslogtreecommitdiff
path: root/builtin-ls-files.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-03-17 09:03:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-22 06:19:27 (GMT)
commit67c176f549daf5530cabbb801de2b5feb0db82f4 (patch)
tree0861313fdbeecfd571e59c9c12b75751faa0617e /builtin-ls-files.c
parent7ad3c52e2dc8e81aafa615fb8b65ad99b6a62172 (diff)
downloadgit-67c176f549daf5530cabbb801de2b5feb0db82f4.zip
git-67c176f549daf5530cabbb801de2b5feb0db82f4.tar.gz
git-67c176f549daf5530cabbb801de2b5feb0db82f4.tar.bz2
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>
Diffstat (limited to 'builtin-ls-files.c')
-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 9dec282..ca6f33d 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")) {