Skip to content

Commit

Permalink
Teach ls-files --with-tree=<tree> to work with options other than -c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Nov 16, 2008
1 parent 07e77e4 commit 4b4e26d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin-ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4b4e26d

Please sign in to comment.