Skip to content

Commit 487beee

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a46160d commit 487beee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apply.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4702,13 +4702,13 @@ static int apply_patch(struct apply_state *state,
47024702
goto end;
47034703
}
47044704

4705-
if (state->diffstat)
4705+
if (state->diffstat && state->apply_verbosity > verbosity_silent)
47064706
stat_patch_list(state, list);
47074707

4708-
if (state->numstat)
4708+
if (state->numstat && state->apply_verbosity > verbosity_silent)
47094709
numstat_patch_list(state, list);
47104710

4711-
if (state->summary)
4711+
if (state->summary && state->apply_verbosity > verbosity_silent)
47124712
summary_patch_list(list);
47134713

47144714
end:

0 commit comments

Comments
 (0)