Trying a gc prefix.
[git-central.git] / tests / t5200-script-pull.sh
1 #!/bin/sh
2
3 test_description='script pull'
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 checkout -b stable &&
17         git push origin stable
18 '
19
20 test_expect_success 'pull does a rebase' '
21         gc-checkout topic1 &&
22         echo "$test_name" >a.topic1 &&
23         git add a.topic1 &&
24         git commit -m "move topic1" &&
25
26         # Move topic1 on the server
27         cd server &&
28         git checkout topic1 &&
29         echo "$test_name" >a &&
30         git commit -a -m "move topic1 on the server" &&
31         cd .. &&
32
33         # Only one parent
34         gc-pull &&
35         git cat-file commit $(git rev-parse HEAD) | grep parent | wc -l | grep 1
36 '
37
38 #test_expect_success 'pull does a rebase but does not fuck up merges' '
39 #       # Change "a" itself so we will eventually conflict
40 #       gc-checkout topic2 &&
41 #       echo "$test_name on topic2" >a &&
42 #       git commit -a -m "move topic2" &&
43 #
44 #       # Change a.topic2 as well for another commit to continue rebasing after fixing the conflict
45 #       echo "$test_name on topic2" >a.topic2 &&
46 #       git add a.topic2 &&
47 #       git commit -m "move a.topic2" &&
48 #
49 #       # Move stable
50 #       git checkout stable &&
51 #       echo "$test_name on stable" >a &&
52 #       git commit -a -m "move stable" &&
53 #       git push origin stable &&
54 #
55 #       # Move topic2 on the server, then merge stable
56 #       cd server &&
57 #       git checkout stable &&
58 #       echo "$test_name on stable server" >a.stable.server &&
59 #       git add a.stable.server &&
60 #       git commit -m "move stable server" &&
61 #       git checkout topic2 &&
62 #       echo "$test_name" >a.topic2.server &&
63 #       git add a.topic2.server &&
64 #       git commit -m "move topic2 on the server" &&
65 #       git merge stable &&
66 #       cd .. &&
67 #
68 #       # Merge stable locally too--should conflict
69 #       git checkout topic2 &&
70 #       git merge origin/stable
71 #
72 #       # Now pull and see what happens
73 #       # gc-pull
74 #'
75
76 test_done
77