summaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-04-17 10:23:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-18 04:49:29 (GMT)
commit1055997e2fc707a15baf232df2ac481055c14321 (patch)
tree4d32fd986b4c02811266f3db3d087858afcd4a53 /t/t7600-merge.sh
parentd540b70c85ccd08507348785fd210ef8317a864d (diff)
downloadgit-1055997e2fc707a15baf232df2ac481055c14321.zip
git-1055997e2fc707a15baf232df2ac481055c14321.tar.gz
git-1055997e2fc707a15baf232df2ac481055c14321.tar.bz2
merge: add scissors line on merge conflict
This fixes a bug where the scissors line is placed after the Conflicts: section, in the case where a merge conflict occurs and commit.cleanup = scissors. Next, if commit.cleanup = scissors is specified, don't produce a scissors line in commit if one already exists in the MERGE_MSG file. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 2f4c280..7f9c68c 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -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' '