3 test_description='server pre-receive only one branch/push'
7 test_expect_success 'setup' '
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 &&
19 install_server_hook 'pre-receive-only-one' 'pre-receive'
21 test_expect_success 'pushing just topic is okay' '
22 git checkout -b topic &&
23 echo "$test_name" >a &&
24 git commit -a -m "$test_name on topic" &&
28 test_expect_success 'pushing just master is okay' '
29 git checkout master &&
30 echo "$test_name" >a &&
31 git commit -a -m "$test_name on master" &&
35 test_expect_success 'pushing both master and topic fails' '
36 echo "$test_name" >a &&
37 git commit -a -m "$test_name on master" &&
40 echo "$test_name" >a &&
41 git commit -a -m "$test_name on topic" &&
43 ! git push 2>push.err &&
44 cat push.err | grep "Only push one branch at a time"