Fix old-style function declaration
[git/dscho.git] / t / t7604-merge-custom-message.sh
blobb84cea3498676dbfde518b5cb230b859387bfc8e
1 #!/bin/sh
3 test_description='git merge
5 Testing merge when using a custom message for the merge commit.'
7 . ./test-lib.sh
9 create_merge_msgs() {
10 echo >exp.subject "custom message"
12 cp exp.subject exp.log &&
13 echo >>exp.log "" &&
14 echo >>exp.log "By A U Thor" &&
15 echo >>exp.log "* tag 'c2':" &&
16 echo >>exp.log " c2"
19 test_expect_success 'setup' '
20 echo c0 > c0.c &&
21 git add c0.c &&
22 git commit -m c0 &&
23 git tag c0 &&
24 echo c1 > c1.c &&
25 git add c1.c &&
26 git commit -m c1 &&
27 git tag c1 &&
28 git reset --hard c0 &&
29 echo c2 > c2.c &&
30 git add c2.c &&
31 git commit -m c2 &&
32 git tag c2 &&
33 create_merge_msgs
37 test_expect_success 'merge c2 with a custom message' '
38 git reset --hard c1 &&
39 git merge -m "$(cat exp.subject)" c2 &&
40 git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
41 test_cmp exp.subject actual
44 test_expect_success 'merge --log appends to custom message' '
45 git reset --hard c1 &&
46 git merge --log -m "$(cat exp.subject)" c2 &&
47 git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
48 test_cmp exp.log actual
51 test_done