71d694e669beb10f6926969d24bee209d81fd55f
[git-central.git] / tests / t2001-server-update-ensure-ticket-reference-merges.sh
1 #!/bin/sh
2
3 test_description='server update trac ticket enforcer via shim'
4
5 . ./test-lib.sh
6
7 test_expect_success 'setup' '
8         echo "setup" >a &&
9         git add a &&
10         git commit -m "setup" &&
11         git clone ./. server &&
12         rm -fr server/.git/hooks &&
13         git remote add origin ./server &&
14         git config --add branch.master.remote origin &&
15         git config --add branch.master.merge refs/heads/master
16 '
17
18 # setup the hook
19 install_server_hook 'update-ensure-ticket-reference' 'update'
20
21 test_expect_success 'accept merge with merge message' '
22         git checkout -b topic1 master &&
23         echo "$test_name" >a1 &&
24         git add a1 &&
25         git commit -m "$test_name topic1 re #1" &&
26         git push origin topic1 &&
27
28         git checkout -b topic2 master &&
29         echo "$test_name" >a2 &&
30         git add a2 &&
31         git commit -m "$test_name topic2 re #2" &&
32         git push origin topic2 &&
33
34         git checkout topic1 &&
35         echo "$test_name" >>a1 &&
36         git commit -a -m "$test_name topic1 re #1 again" &&
37         git merge topic2 &&
38         git push
39 '
40
41 test_done
42