]> granicus.if.org Git - git/commitdiff
ref-filter: simplify automatic color reset
authorJeff King <peff@peff.net>
Thu, 13 Jul 2017 14:58:56 +0000 (10:58 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Jul 2017 19:42:50 +0000 (12:42 -0700)
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>
ref-filter.c

index ae6ecbd1cfe42936b22488d7761e4e487e2922ca..6da5be3ac6dd656c7b91f1a401d0f7e59c24cc64 100644 (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)