提交 4b4e26d2 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <gitster@pobox.com>
上级 07e77e40
...@@ -227,6 +227,8 @@ static void show_files(struct dir_struct *dir, const char *prefix) ...@@ -227,6 +227,8 @@ static void show_files(struct dir_struct *dir, const char *prefix)
int dtype = ce_to_dtype(ce); int dtype = ce_to_dtype(ce);
if (excluded(dir, ce->name, &dtype) != dir->show_ignored) if (excluded(dir, ce->name, &dtype) != dir->show_ignored)
continue; continue;
if (ce->ce_flags & CE_UPDATE)
continue;
err = lstat(ce->name, &st); err = lstat(ce->name, &st);
if (show_deleted && err) if (show_deleted && err)
show_ce_entry(tag_removed, ce); show_ce_entry(tag_removed, ce);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册