From 07e77e40ff5d2cb6c7e2c5a68d9748f7811da85e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 16 Nov 2008 00:15:43 -0800 Subject: [PATCH 1/2] builtin-ls-files.c: coding style fix. Signed-off-by: Junio C Hamano --- builtin-ls-files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-ls-files.c b/builtin-ls-files.c index b48327db95..21b0bf75f7 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -329,7 +329,7 @@ void overlay_tree_on_cache(const char *tree_name, const char *prefix) if (prefix) { static const char *(matchbuf[2]); matchbuf[0] = prefix; - matchbuf [1] = NULL; + matchbuf[1] = NULL; match = matchbuf; } else match = NULL; From 4b4e26d21f77d9e90125ca1c8f48592a9cd6f543 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 16 Nov 2008 00:10:25 -0800 Subject: [PATCH 2/2] Teach ls-files --with-tree= to work with options other than -c Originally --with-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 --- builtin-ls-files.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 21b0bf75f7..f72eb85475 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);