From: Jeff King Date: Thu, 13 Jul 2017 14:58:56 +0000 (-0400) Subject: ref-filter: simplify automatic color reset X-Git-Tag: v2.14.2~61^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/ref-filter.c b/ref-filter.c index ae6ecbd1cf..6da5be3ac6 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -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)