Merge branch 'jk/status-z-short-fix'

The "--short" option of "git status" that meant output for humans
and "-z" option to show NUL delimited output format did not mix
well, and colored some but not all things.  The command has been
updated to color all elements consistently in such a case.

* jk/status-z-short-fix:
  status: make coloring of "-z --short" consistent
This commit is contained in:
Junio C Hamano
2025-10-24 13:48:04 -07:00
2 changed files with 13 additions and 2 deletions

View File

@@ -2042,13 +2042,13 @@ static void wt_shortstatus_status(struct string_list_item *it,
static void wt_shortstatus_other(struct string_list_item *it,
struct wt_status *s, const char *sign)
{
color_fprintf(s->fp, color(WT_STATUS_UNTRACKED, s), "%s", sign);
if (s->null_termination) {
fprintf(s->fp, "%s %s%c", sign, it->string, 0);
fprintf(s->fp, " %s%c", it->string, 0);
} else {
struct strbuf onebuf = STRBUF_INIT;
const char *one;
one = quote_path(it->string, s->prefix, &onebuf, QUOTE_PATH_QUOTE_SP);
color_fprintf(s->fp, color(WT_STATUS_UNTRACKED, s), "%s", sign);
fprintf(s->fp, " %s\n", one);
strbuf_release(&onebuf);
}