summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-16 08:10:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-16 08:15:50 (GMT)
commit4b4e26d21f77d9e90125ca1c8f48592a9cd6f543 (patch)
tree447f21f17a4292809577edface34daccc967f737
parent07e77e40ff5d2cb6c7e2c5a68d9748f7811da85e (diff)
downloadgit-4b4e26d21f77d9e90125ca1c8f48592a9cd6f543.zip
git-4b4e26d21f77d9e90125ca1c8f48592a9cd6f543.tar.gz
git-4b4e26d21f77d9e90125ca1c8f48592a9cd6f543.tar.bz2
Teach ls-files --with-tree=<tree> to work with options other than -c
Originally --with-tree=<tree> was designed for the sole purpose of checking if a given pathspec makes sense as a parameter to git-commit using it in conjunction with --error-unmatch. It had logic to avoid showing the same entry (one came from the original index, another from the overlayed tree) twice so that it works with -c (i.e. "show-cached"), but otherwise it was not designed to work with the flags such as -m, -d, etc. This teaches the same logic to cover the codepath for -m and -d. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-ls-files.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 21b0bf7..f72eb85 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -227,6 +227,8 @@ static void show_files(struct dir_struct *dir, const char *prefix)
int dtype = ce_to_dtype(ce);
if (excluded(dir, ce->name, &dtype) != dir->show_ignored)
continue;
+ if (ce->ce_flags & CE_UPDATE)
+ continue;
err = lstat(ce->name, &st);
if (show_deleted && err)
show_ce_entry(tag_removed, ce);