diff options
author | Christian Couder <christian.couder@gmail.com> | 2016-07-30 19:25:04 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-01 15:01:09 -0700 |
commit | 284a0176ee57b640d7364c0a22f2dd3b763ffd11 (patch) | |
tree | aadc2e4b085fe605d907f5bf3605f44de066e23c | |
parent | 331112fa73ba60700f13275e798bb066e9d7133e (diff) | |
download | git-284a0176ee57b640d7364c0a22f2dd3b763ffd11.tar.gz |
apply: don't print on stdout in verbosity_silent mode
When apply_verbosity is set to verbosity_silent nothing should be
printed on both stderr and stdout.
To avoid printing on stdout, we can just skip calling the following
functions:
- stat_patch_list(),
- numstat_patch_list(),
- summary_patch_list().
It is safe to do that because the above functions have no side
effects other than printing:
- stat_patch_list() only computes some local values and then call
show_stats() and print_stat_summary(), those two functions only
compute local values and call printing functions,
- numstat_patch_list() also only computes local values and calls
printing functions,
- summary_patch_list() calls show_file_mode_name(), printf(),
show_rename_copy(), show_mode_change() that are only printing.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | apply.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4699,13 +4699,13 @@ static int apply_patch(struct apply_state *state, goto end; } - if (state->diffstat) + if (state->diffstat && state->apply_verbosity > verbosity_silent) stat_patch_list(state, list); - if (state->numstat) + if (state->numstat && state->apply_verbosity > verbosity_silent) numstat_patch_list(state, list); - if (state->summary) + if (state->summary && state->apply_verbosity > verbosity_silent) summary_patch_list(list); end: |