]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add -i: use `reset_color` consistently
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 11 Nov 2020 12:28:17 +0000 (12:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Nov 2020 17:07:52 +0000 (09:07 -0800)
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>
add-patch.c

index 55bd9d4f3758b8f710e1bc1c2a172d13aa7eafe3..1db674414b33a0266932a982854fd647d0f0b71e 100644 (file)
@@ -672,7 +672,7 @@ static void render_hunk(struct add_p_state *s, struct hunk *hunk,
                if (len)
                        strbuf_add(out, p, len);
                else if (colored)
-                       strbuf_addf(out, "%s\n", GIT_COLOR_RESET);
+                       strbuf_addf(out, "%s\n", s->s.reset_color);
                else
                        strbuf_addch(out, '\n');
        }
@@ -1065,7 +1065,7 @@ static void recolor_hunk(struct add_p_state *s, struct hunk *hunk)
                              s->s.file_new_color :
                              s->s.context_color);
                strbuf_add(&s->colored, plain + current, eol - current);
-               strbuf_addstr(&s->colored, GIT_COLOR_RESET);
+               strbuf_addstr(&s->colored, s->s.reset_color);
                if (next > eol)
                        strbuf_add(&s->colored, plain + eol, next - eol);
                current = next;