Skip to content

Commit 6f1a5ca

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent decc9ee commit 6f1a5ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

add-patch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ static void render_hunk(struct add_p_state *s, struct hunk *hunk,
672672
if (len)
673673
strbuf_add(out, p, len);
674674
else if (colored)
675-
strbuf_addf(out, "%s\n", GIT_COLOR_RESET);
675+
strbuf_addf(out, "%s\n", s->s.reset_color);
676676
else
677677
strbuf_addch(out, '\n');
678678
}
@@ -1065,7 +1065,7 @@ static void recolor_hunk(struct add_p_state *s, struct hunk *hunk)
10651065
s->s.file_new_color :
10661066
s->s.context_color);
10671067
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);
10691069
if (next > eol)
10701070
strbuf_add(&s->colored, plain + eol, next - eol);
10711071
current = next;

0 commit comments

Comments
 (0)