]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7600-merge.sh
Merge branch 'ab/hash-object-doc' into maint
[thirdparty/git.git] / t / t7600-merge.sh
index 2f4c2801fb8014c04a95fb04912f0a3bda55d11b..4ec5d9ec790a0d54f4883fc118b5df25c94f43f4 100755 (executable)
@@ -246,6 +246,52 @@ test_expect_success 'merge --squash c3 with c7' '
        test_cmp expect actual
 '
 
+test_expect_success 'merge c3 with c7 with commit.cleanup = scissors' '
+       git config commit.cleanup scissors &&
+       git reset --hard c3 &&
+       test_must_fail git merge c7 &&
+       cat result.9z >file &&
+       git commit --no-edit -a &&
+
+       cat >expect <<-\EOF &&
+       Merge tag '"'"'c7'"'"'
+
+       # ------------------------ >8 ------------------------
+       # Do not modify or remove the line above.
+       # Everything below it will be ignored.
+       #
+       # Conflicts:
+       #       file
+       EOF
+       git cat-file commit HEAD >raw &&
+       sed -e '1,/^$/d' raw >actual &&
+       test_i18ncmp expect actual
+'
+
+test_expect_success 'merge c3 with c7 with --squash commit.cleanup = scissors' '
+       git config commit.cleanup scissors &&
+       git reset --hard c3 &&
+       test_must_fail git merge --squash c7 &&
+       cat result.9z >file &&
+       git commit --no-edit -a &&
+
+       cat >expect <<-EOF &&
+       Squashed commit of the following:
+
+       $(git show -s c7)
+
+       # ------------------------ >8 ------------------------
+       # Do not modify or remove the line above.
+       # Everything below it will be ignored.
+       #
+       # Conflicts:
+       #       file
+       EOF
+       git cat-file commit HEAD >raw &&
+       sed -e '1,/^$/d' raw >actual &&
+       test_i18ncmp expect actual
+'
+
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 and c3' '
@@ -524,6 +570,12 @@ test_expect_success 'combining --squash and --no-ff is refused' '
        test_must_fail git merge --no-ff --squash c1
 '
 
+test_expect_success 'combining --squash and --commit is refused' '
+       git reset --hard c0 &&
+       test_must_fail git merge --squash --commit c1 &&
+       test_must_fail git merge --commit --squash c1
+'
+
 test_expect_success 'option --ff-only overwrites --no-ff' '
        git merge --no-ff --ff-only c1 &&
        test_must_fail git merge --no-ff --ff-only c2