Re: [PATCH 4/4] Add a second testcase for handling invalid strategies in git-merge

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 4/4] Add a second testcase for handling invalid strategies in git-merge

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:04

Miklos Vajna [off-list ref] writes:
quoted hunk
This one tests '-s index' which is interesting because git-merge-index
is an existing git command but it is not a valid strategy.

Signed-off-by: Miklos Vajna <redacted>
---
 t/t7600-merge.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 5eeb6c2..0329aee 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -230,6 +230,10 @@ test_expect_success 'test option parsing' '
 	test_must_fail git merge
 '
 
+test_expect_success 'reject non-strategy with a git-merge-foo name' '
+	test_must_fail git merge -s index c1
+'
+
True, but with the old code that might blindly have executed
git-merge-index the test would also have failed, and you would want to
tell two cases apart, wouldn't you?

Re: [PATCH 4/4] Add a second testcase for handling invalid strategies in git-merge

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:45:05

On Tue, Jul 29, 2008 at 04:42:53PM -0700, Junio C Hamano [off-list ref] wrote:
True, but with the old code that might blindly have executed
git-merge-index the test would also have failed, and you would want to
tell two cases apart, wouldn't you?
Hmm, I wonder what is the right approach to test it. Should I exit with
a different error code with the strategy is invalid?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help