diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-16 16:08:28 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-16 15:59:02 -0800 |
commit | 6681e3603216f0e279fea467a0e6d829fffb82a5 (patch) | |
tree | 5f2bc3f8b48c70378bf3b3f08f38715f82dd16d9 | |
parent | add -i (built-in): use correct names to load color.diff.* config (diff) | |
download | tgif-6681e3603216f0e279fea467a0e6d829fffb82a5.tar.xz |
add -p (built-in): do not color the progress indicator separately
The Perl version of this command colors the progress indicator and the
prompt message in one go.
Let's do the same in the built-in version so that the same upcoming test
(which will compare the output of `git add -p` against a known-good
version) will pass both for the Perl version as well as for the built-in
version.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | add-patch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/add-patch.c b/add-patch.c index 1db674414b..8ad0937e6c 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1461,15 +1461,15 @@ static int patch_update_file(struct add_p_state *s, else prompt_mode_type = PROMPT_HUNK; - color_fprintf(stdout, s->s.prompt_color, - "(%"PRIuMAX"/%"PRIuMAX") ", + printf("%s(%"PRIuMAX"/%"PRIuMAX") ", s->s.prompt_color, (uintmax_t)hunk_index + 1, (uintmax_t)(file_diff->hunk_nr ? file_diff->hunk_nr : 1)); - color_fprintf(stdout, s->s.prompt_color, - _(s->mode->prompt_mode[prompt_mode_type]), - s->buf.buf); + printf(_(s->mode->prompt_mode[prompt_mode_type]), + s->buf.buf); + if (*s->s.reset_color) + fputs(s->s.reset_color, stdout); fflush(stdout); if (read_single_character(s) == EOF) break; |