[PATCH 04/15] ref-filter: simplify automatic color reset
- From
Jeff King <peff@peff.net>
- Date
- Jul 13, 2017, 14:58 UTC
- Message-ID
- <20170713145856.ckciq3z5fparijaz@sigill.intra.peff.net>
- In-Reply-To
- <20170713145553.3epnsw23zajwg3ee@sigill.intra.peff.net>
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> --- ref-filter.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c index ae6ecbd1c..6da5be3ac 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)
-- 2.13.2.1157.gc6daca446