Skip to content

Commit 4b4e26d

Browse files
committed
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 <[email protected]>
1 parent 07e77e4 commit 4b4e26d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin-ls-files.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ static void show_files(struct dir_struct *dir, const char *prefix)
227227
int dtype = ce_to_dtype(ce);
228228
if (excluded(dir, ce->name, &dtype) != dir->show_ignored)
229229
continue;
230+
if (ce->ce_flags & CE_UPDATE)
231+
continue;
230232
err = lstat(ce->name, &st);
231233
if (show_deleted && err)
232234
show_ce_entry(tag_removed, ce);

0 commit comments

Comments
 (0)