]> git.ipfire.org Git - thirdparty/git.git/commit - apply.h
apply: change error_routine when silent
authorChristian Couder <christian.couder@gmail.com>
Sun, 4 Sep 2016 20:18:29 +0000 (22:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Sep 2016 19:29:53 +0000 (12:29 -0700)
commit45b78d8ba3c9e542f1375171090fe10baef6b2b2
tree285c8ce6701cc10b4f3c7b0f420cdd7435b39c5f
parent725149beab088b1368cc01aa3f1a7845db14132d
apply: change error_routine when silent

To avoid printing anything when applying with
`state->apply_verbosity == verbosity_silent`, let's save the
existing warn and error routines before applying, and let's
replace them with a routine that does nothing.

Then after applying, let's restore the saved routines.

Note that, as we need to restore the saved routines in all
cases, we cannot return early any more in apply_all_patches().

Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c
apply.h