From: Christian Couder Date: Mon, 27 Jun 2016 18:24:23 GMT Subject: [PATCH v8 35/41] apply: make 'be_silent' incompatible with 'apply_verbosely' Message-ID: <20160627182429.31550-36-chriscool@tuxfamily.org> In-Reply-To: <20160627182429.31550-1-chriscool@tuxfamily.org> It should be an error to have both be_silent and apply_verbosely set, so let's check that in check_apply_state(). And by the way let's not automatically set apply_verbosely when be_silent is set. Signed-off-by: Christian Couder --- apply.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apply.c b/apply.c index 802fa79..1435f85 100644 --- a/apply.c +++ b/apply.c @@ -122,8 +122,11 @@ int check_apply_state(struct apply_state *state, int force_apply) return error(_("--3way outside a repository")); state->check_index = 1; } - if (state->apply_with_reject) - state->apply = state->apply_verbosely = 1; + if (state->apply_with_reject) { + state->apply = 1; + if (!state->be_silent) + state->apply_verbosely = 1; + } if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor)) state->apply = 0; if (state->check_index && is_not_gitdir) @@ -135,6 +138,8 @@ int check_apply_state(struct apply_state *state, int force_apply) } if (state->check_index) state->unsafe_paths = 0; + if (state->be_silent && state->apply_verbosely) + return error(_("incompatible internal 'be_silent' and 'apply_verbosely' flags")); if (!state->lock_file) return error("BUG: state->lock_file should not be NULL"); -- 2.9.0.172.gfb57a78