Merge branch 'js/mingw-isatty-and-dup2'
[gitweb.git] / t / t7600-merge.sh
index dfde6a675a8cd28297324627923a861bc7410ff2..106148254d0ce067e8f5f842faac8fbf1ee90f15 100755 (executable)
@@ -38,7 +38,6 @@ printf '%s\n' '1 X' 2 3 4 5 6 7 8 9 >result.1
 printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 9 >result.1-5
 printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9
 printf '%s\n' 1 2 3 4 5 6 7 8 '9 Z' >result.9z
->empty
 
 create_merge_msgs () {
        echo "Merge tag 'c2'" >msg.1-5 &&
@@ -58,8 +57,6 @@ create_merge_msgs () {
                echo &&
                git log --no-merges ^HEAD c2 c3
        } >squash.1-5-9 &&
-       : >msg.nologff &&
-       : >msg.nolognoff &&
        {
                echo "* tag 'c3':" &&
                echo "  commit 3"
@@ -519,7 +516,7 @@ test_expect_success 'tolerate unknown values for merge.ff' '
        test_tick &&
        git merge c1 2>message &&
        verify_head "$c1" &&
-       test_cmp empty message
+       test_must_be_empty message
 '
 
 test_expect_success 'combining --squash and --no-ff is refused' '
@@ -551,13 +548,13 @@ test_expect_success 'merge log message' '
        git reset --hard c0 &&
        git merge --no-log c2 &&
        git show -s --pretty=format:%b HEAD >msg.act &&
-       test_cmp msg.nologff msg.act &&
+       test_must_be_empty msg.act &&
 
        git reset --hard c0 &&
        test_config branch.master.mergeoptions "--no-ff" &&
        git merge --no-log c2 &&
        git show -s --pretty=format:%b HEAD >msg.act &&
-       test_cmp msg.nolognoff msg.act &&
+       test_must_be_empty msg.act &&
 
        git merge --log c3 &&
        git show -s --pretty=format:%b HEAD >msg.act &&
@@ -700,6 +697,42 @@ test_expect_success 'merge --no-ff --edit' '
        test_cmp expected actual
 '
 
+test_expect_success 'merge annotated/signed tag w/o tracking' '
+       test_when_finished "rm -rf dst; git tag -d anno1" &&
+       git tag -a -m "anno c1" anno1 c1 &&
+       git init dst &&
+       git rev-parse c1 >dst/expect &&
+       (
+               # c0 fast-forwards to c1 but because this repository
+               # is not a "downstream" whose refs/tags follows along
+               # tag from the "upstream", this pull defaults to --no-ff
+               cd dst &&
+               git pull .. c0 &&
+               git pull .. anno1 &&
+               git rev-parse HEAD^2 >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'merge annotated/signed tag w/ tracking' '
+       test_when_finished "rm -rf dst; git tag -d anno1" &&
+       git tag -a -m "anno c1" anno1 c1 &&
+       git init dst &&
+       git rev-parse c1 >dst/expect &&
+       (
+               # c0 fast-forwards to c1 and because this repository
+               # is a "downstream" whose refs/tags follows along
+               # tag from the "upstream", this pull defaults to --ff
+               cd dst &&
+               git remote add origin .. &&
+               git pull origin c0 &&
+               git fetch origin &&
+               git merge anno1 &&
+               git rev-parse HEAD >actual &&
+               test_cmp expect actual
+       )
+'
+
 test_expect_success GPG 'merge --ff-only tag' '
        git reset --hard c0 &&
        git commit --allow-empty -m "A newer commit" &&
@@ -718,7 +751,7 @@ test_expect_success GPG 'merge --no-edit tag should skip editor' '
        git tag -f -s -m "A newer commit" signed &&
        git reset --hard c0 &&
 
-       EDITOR=false git merge --no-edit signed &&
+       EDITOR=false git merge --no-edit --no-ff signed &&
        git rev-parse signed^0 >expect &&
        git rev-parse HEAD^2 >actual &&
        test_cmp expect actual