提交 2bcab240 编写于 作者: J Junio C Hamano

ls-files: debugging aid for CE_VALID changes.

This is not really part of the proposed updates for CE_VALID,
but with this change, ls-files -t shows CE_VALID paths with
lowercase tag letters instead of the usual uppercase.  Useful
for checking out what is going on.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 8b9b0f3a
...@@ -447,6 +447,22 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce) ...@@ -447,6 +447,22 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce)
if (pathspec && !match(pathspec, ce->name, len)) if (pathspec && !match(pathspec, ce->name, len))
return; return;
if (tag && *tag && (ce->ce_flags & htons(CE_VALID))) {
static char alttag[4];
memcpy(alttag, tag, 3);
if (isalpha(tag[0]))
alttag[0] = tolower(tag[0]);
else if (tag[0] == '?')
alttag[0] = '!';
else {
alttag[0] = 'v';
alttag[1] = tag[0];
alttag[2] = ' ';
alttag[3] = 0;
}
tag = alttag;
}
if (!show_stage) { if (!show_stage) {
fputs(tag, stdout); fputs(tag, stdout);
write_name_quoted("", 0, ce->name + offset, write_name_quoted("", 0, ce->name + offset,
...@@ -503,7 +519,7 @@ static void show_files(void) ...@@ -503,7 +519,7 @@ static void show_files(void)
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);
if (show_modified && ce_modified(ce, &st)) if (show_modified && ce_modified(ce, &st, 0))
show_ce_entry(tag_modified, ce); show_ce_entry(tag_modified, ce);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册