f05a48c7f176f161b8a62bed3f6b8b9d0779cb1e
[git-central.git] / tests / t2600-server-update-prefer-underscores.sh
1 #!/bin/sh
2
3 test_description='server update prefer underscores in branch names'
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         git fetch &&
17         git checkout -b stable &&
18         git push origin stable
19 '
20
21 install_update_hook 'update-prefer-underscores'
22
23 test_expect_success 'pushing topic_topic works' '
24         git checkout -b topic_topic &&
25         echo "$test_name" >a &&
26         git commit -a -m "$test_name on topic_topic" &&
27         git push origin topic_topic
28 '
29
30 test_expect_success 'pushing topicTopic fails' '
31         git checkout -b topicTopic &&
32         echo "$test_name" >a &&
33         git commit -a -m "$test_name on topicTopic" &&
34         ! git push origin topicTopic 2>push.err &&
35         cat push.err | grep "Please use underscored branch names"
36 '
37
38 test_done
39