3 test_description
='test auto-generated merge messages'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 TEST_PASSES_SANITIZE_LEAK
=true
11 echo "$1" |
sed "s/Q/'/g" >expect
&&
12 git log
-1 --pretty=tformat
:%s
>actual
&&
13 test_cmp expect actual
16 test_expect_success
'merge local branch' '
18 git checkout -b local-branch &&
19 test_commit branch-1 &&
22 git merge local-branch &&
23 check_oneline "Merge branch Qlocal-branchQ"
26 test_expect_success
'merge octopus branches' '
27 git checkout -b octopus-a main &&
28 test_commit octopus-1 &&
29 git checkout -b octopus-b main &&
30 test_commit octopus-2 &&
32 git merge octopus-a octopus-b &&
33 check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
36 test_expect_success
'merge tag' '
37 git checkout -b tag-branch main &&
42 check_oneline "Merge tag Qtag-1Q"
45 test_expect_success
'ambiguous tag' '
46 git checkout -b ambiguous main &&
47 test_commit ambiguous &&
50 git merge ambiguous &&
51 check_oneline "Merge tag QambiguousQ"
54 test_expect_success
'remote-tracking branch' '
55 git checkout -b remote main &&
56 test_commit remote-1 &&
57 git update-ref refs/remotes/origin/main remote &&
60 git merge origin/main &&
61 check_oneline "Merge remote-tracking branch Qorigin/mainQ"