summaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-07-13 14:58:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-13 19:42:50 (GMT)
commit51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a (patch)
tree0c29f668dcc53c3c98ddf851423e179f624d5520 /ref-filter.c
parent097b681baac3a5e9455c74e3072a458249691e40 (diff)
downloadgit-51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a.zip
git-51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a.tar.gz
git-51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a.tar.bz2
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>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ref-filter.c b/ref-filter.c
index ae6ecbd..6da5be3 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)