ref-filter: simplify automatic color reset

When the user-format doesn't add the closing color reset, we
add one automatically. But we do so by parsing the "reset"
string. We can just use the baked-in string literal, which
is simpler.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jeff King 2017-07-13 10:58:56 -04:00 committed by Junio C Hamano
parent 097b681baa
commit 51331aad69
1 changed files with 1 additions and 5 deletions

View File

@ -2084,11 +2084,7 @@ void format_ref_array_item(struct ref_array_item *info, const char *format,
}
if (need_color_reset_at_eol) {
struct atom_value resetv;
char color[COLOR_MAXLEN] = "";

if (color_parse("reset", color) < 0)
die("BUG: couldn't parse 'reset' as a color");
resetv.s = color;
resetv.s = GIT_COLOR_RESET;
append_atom(&resetv, &state);
}
if (state.stack->prev)