3 test_description
='test auto-generated merge messages'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10 echo "$1" |
sed "s/Q/'/g" >expect
&&
11 git log
-1 --pretty=tformat
:%s
>actual
&&
12 test_cmp expect actual
15 test_expect_success
'merge local branch' '
17 git checkout -b local-branch &&
18 test_commit branch-1 &&
21 git merge local-branch &&
22 check_oneline "Merge branch Qlocal-branchQ"
25 test_expect_success
'merge octopus branches' '
26 git checkout -b octopus-a main &&
27 test_commit octopus-1 &&
28 git checkout -b octopus-b main &&
29 test_commit octopus-2 &&
31 git merge octopus-a octopus-b &&
32 check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
35 test_expect_success
'merge tag' '
36 git checkout -b tag-branch main &&
41 check_oneline "Merge tag Qtag-1Q"
44 test_expect_success
'ambiguous tag' '
45 git checkout -b ambiguous main &&
46 test_commit ambiguous &&
49 git merge ambiguous &&
50 check_oneline "Merge tag QambiguousQ"
53 test_expect_success
'remote-tracking branch' '
54 git checkout -b remote main &&
55 test_commit remote-1 &&
56 git update-ref refs/remotes/origin/main remote &&
59 git merge origin/main &&
60 check_oneline "Merge remote-tracking branch Qorigin/mainQ"