[PATCH] t7600: merge tag shoud create a merge commit
- From
- y@quest-ce.net <y@quest-ce.net>
- Date
- Mar 22, 2013, 10:57 UTC
- Message-ID
- <1363949850-11927-1-git-send-email-y>
- In-Reply-To
- <1363704914.6289.39.camel@test.quest-ce.net>
From: Yann Droneaud <ydroneaud@opteya.com>
This test ensures a merge commit is always created when merging an annotated (signed) tag without --ff-only option.
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> ---
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