587e0362fd4546fda7c8387a70f1ca6fc598da6e
[git-central.git] / tests / t5100-push.sh
1 #!/bin/sh
2
3 test_description='script create branch'
4
5 . ./test-lib.sh
6
7 export PATH=$PATH:../../scripts
8
9 test_expect_success 'setup' '
10         echo "setup" >a &&
11         git add a &&
12         git commit -m "setup" &&
13         git clone ./. server &&
14         rm -fr server/.git/hooks &&
15         git remote add origin ./server &&
16         git config branch.master.remote origin &&
17         git config branch.master.merge refs/heads/master &&
18         git fetch &&
19
20         git checkout -b stable &&
21         git push origin stable
22 '
23
24 test_expect_success 'push only does one branch' '
25         checkout topic1 &&
26         echo "$test_name" >a &&
27         git commit -a -m "move topic1" &&
28         git rev-parse HEAD >head.topic1 &&
29
30         checkout topic2 &&
31         echo "$test_name" >a &&
32         git commit -a -m "move topic2" &&
33         git rev-parse HEAD >head.topic2 &&
34
35         push &&
36         git rev-parse origin/topic2 >head.origin.topic2 &&
37         git rev-parse origin/topic1 >head.origin.topic1 &&
38
39         test_cmp head.topic2 head.origin.topic2 &&
40         ! test_cmp head.topic2 head.origin.topic1
41 '
42
43 test_done
44