Thread (6 messages) flat view 6 messages, 3 authors, 2016-08-14
DORMANTno replies

[PATCH] t7600: merge tag shoud create a merge commit

From: <hidden>
Date: 2016-08-14 00:39:47
Subsystem: the rest · Maintainer: Linus Torvalds

From: Yann Droneaud <redacted>

This test ensures a merge commit is always created
when merging an annotated (signed) tag without --ff-only option.

Signed-off-by: Yann Droneaud <redacted>
---

Here's a proposition for a test tath check the creation of a merge commit
when merging a tag.

It's not in final shape: the line 

    EDITOR=false test_must_fail git merge signed

should failed, but doesn't: the commit merge is created with
the default message, just like --no-edit was given.

I'm making a mistake somewhere, since the EDITOR=false trick
works, it's even used in the next test, for --no-edit testing.

Regards.

 t/t7600-merge.sh | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index b524bdb..486f1bf 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -697,10 +697,30 @@ test_expect_success 'merge --no-ff --edit' '
 	test_cmp actual expected
 '
 
+test_expect_failure GPG 'merge tag should create a merge commit' '
+	git reset --hard c0 &&
+	git commit --allow-empty -m "A newer commit" &&
+	git tag -f -s -m "A newer commit" signed &&
+	git reset --hard c0 &&
+
+	git merge signed &&
+	git rev-parse signed^0 >expect &&
+	git rev-parse HEAD^0 >actual &&
+	! test_cmp actual expect &&
+
+	git reset --hard c0 &&
+	git commit --allow-empty -m "An other newer commit" &&
+	git tag -f -s -m "An other newer commit" signed &&
+	git reset --hard c0 &&
+
+	EDITOR=false test_must_fail git merge signed &&
+	verify_head "$c0"
+'
+
 test_expect_success GPG 'merge --ff-only tag' '
 	git reset --hard c0 &&
 	git commit --allow-empty -m "A newer commit" &&
-	git tag -s -m "A newer commit" signed &&
+	git tag -f -s -m "A newer commit" signed &&
 	git reset --hard c0 &&
 
 	git merge --ff-only signed &&
-- 
1.7.11.7
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help