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>
Jeff King committed
Jul 13, 2017 at 10:58 UTC
51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a
1 file changed
+1
-5
ref-filter.c
+1
-5
@@ -2084,11 +2084,7 @@ void format_ref_array_item(struct ref_array_item *info, const char *format,
2084
}
2085
if (need_color_reset_at_eol) {
2086
struct atom_value resetv;
2087
- char color[COLOR_MAXLEN] = "";
2088
-
2089
- if (color_parse("reset", color) < 0)
2090
- die("BUG: couldn't parse 'reset' as a color");
2091
- resetv.s = color;
2087
+ resetv.s = GIT_COLOR_RESET;
2088
append_atom(&resetv, &state);
2089
}
2090
if (state.stack->prev)