Cleaning up scripts to only include useful stuff.
[git-central.git] / tests / t1001-client-commit-msg-trac-merges.sh
1 #!/bin/sh
2
3 test_description='client commit-msg trac ticket enforcer for merges'
4
5 . ./test-lib.sh
6
7 # setup the commit-msg hook
8 install_client_hook 'commit-msg-trac' 'commit-msg'
9
10 test_expect_success 'accepts merge' '
11         echo "$test_name" >file &&
12         git add file &&
13         git commit -m "line one. re #3222." &&
14         git checkout -b topic1 &&
15         echo "$test_name topic1" >>file &&
16         git commit -a -m "line two. re #3222." &&
17         git checkout master &&
18         echo "$test_name" > file2 &&
19         git add file2 &&
20         git commit -m "file2. re #3222." &&
21         git merge topic1 &&
22         git log -n 1 HEAD | grep "Merge branch"
23 '
24
25 test_expect_success 'accepts hand-editted merge' '
26         git checkout topic1 &&
27         echo "$test_name" >>file &&
28         git commit -a -m "line three. re #3222." &&
29         git checkout master &&
30         git merge --no-ff --no-commit topic1 &&
31         git commit -F .git/MERGE_MSG
32 '
33
34 test_done
35