From: Jeff King Date: Tue, 17 Mar 2009 09:03:19 +0000 (-0400) Subject: ls-files: require worktree when --deleted is given X-Git-Tag: v1.6.2.2~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=67c176f549daf5530cabbb801de2b5feb0db82f4;p=git.git 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 --- 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")) {