add -i: use `reset_color` consistently
We already maintain a list of colors in the `add_i_state`, therefore we should use them. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 11, 2020 at 12:28 UTC
6f1a5caa0b69278bc7eb79d3474a1e881bd0c663
1 file changed
+2
-2
add-patch.c
+2
-2
@@ -672,7 +672,7 @@ static void render_hunk(struct add_p_state *s, struct hunk *hunk,
672
if (len)
673
strbuf_add(out, p, len);
674
else if (colored)
675
- strbuf_addf(out, "%s\n", GIT_COLOR_RESET);
675
+ strbuf_addf(out, "%s\n", s->s.reset_color);
676
else
677
strbuf_addch(out, '\n');
678
}
@@ -1065,7 +1065,7 @@ static void recolor_hunk(struct add_p_state *s, struct hunk *hunk)
1065
s->s.file_new_color :
1066
s->s.context_color);
1067
strbuf_add(&s->colored, plain + current, eol - current);
1068
- strbuf_addstr(&s->colored, GIT_COLOR_RESET);
1068
+ strbuf_addstr(&s->colored, s->s.reset_color);
1069
if (next > eol)
1070
strbuf_add(&s->colored, plain + eol, next - eol);
1071
current = next;