Skip to content

Commit 51331aa

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 097b681 commit 51331aa

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ref-filter.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,11 +2084,7 @@ void format_ref_array_item(struct ref_array_item *info, const char *format,
20842084
}
20852085
if (need_color_reset_at_eol) {
20862086
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;
20922088
append_atom(&resetv, &state);
20932089
}
20942090
if (state.stack->prev)

0 commit comments

Comments
 (0)