summaryrefslogtreecommitdiffstats
path: root/builtin-ls-files.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-03-17 10:03:19 +0100
committerJunio C Hamano <gitster@pobox.com>2009-03-22 07:19:27 +0100
commit67c176f549daf5530cabbb801de2b5feb0db82f4 (patch)
tree0861313fdbeecfd571e59c9c12b75751faa0617e /builtin-ls-files.c
parentpickaxe: count regex matches only once (diff)
downloadgit-67c176f549daf5530cabbb801de2b5feb0db82f4.tar.xz
git-67c176f549daf5530cabbb801de2b5feb0db82f4.zip
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 '')
-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")) {