summaryrefslogtreecommitdiff
path: root/add-patch.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-11 12:28:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-11 17:07:52 (GMT)
commit6f1a5caa0b69278bc7eb79d3474a1e881bd0c663 (patch)
treed26f87bff71fe67f801b6a58c5d192d9e83dc631 /add-patch.c
parentdecc9ee4eaf2c33c28e2958439d276904a2ce279 (diff)
downloadgit-6f1a5caa0b69278bc7eb79d3474a1e881bd0c663.zip
git-6f1a5caa0b69278bc7eb79d3474a1e881bd0c663.tar.gz
git-6f1a5caa0b69278bc7eb79d3474a1e881bd0c663.tar.bz2
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>
Diffstat (limited to 'add-patch.c')
-rw-r--r--add-patch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/add-patch.c b/add-patch.c
index 55bd9d4..1db6744 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -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;