From 8ad3dae3a76ee42983da89ea9b5d9a4688f58f93 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 17 Mar 2009 05:03:19 -0400 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- builtin-ls-files.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 9dec282fb..ca6f33d04 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")) { -- 2.26.2