Thread (120 messages) 120 messages, 4 authors, 2016-06-16
STALE3643d

[PATCH v2 87/94] apply: make 'be_silent' incomatible with 'apply_verbosely'

From: Christian Couder <hidden>
Date: 2016-06-16 02:19:19
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 apply.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/apply.c b/apply.c
index f69a61a..5459ee1 100644
--- a/apply.c
+++ b/apply.c
@@ -113,8 +113,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)
@@ -126,6 +129,9 @@ 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"));
+
 	return 0;
 }
 
-- 
2.8.2.490.g3dabe57
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help