3 test_description='script pull'
7 export PATH=$PATH:../../scripts
9 test_expect_success 'setup' '
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
20 test_expect_success 'pull does a rebase' '
22 echo "$test_name" >a.topic1 &&
24 git commit -m "move topic1" &&
26 # Move topic1 on the server
28 git checkout topic1 &&
29 echo "$test_name" >a &&
30 git commit -a -m "move topic1 on the server" &&
35 test 1 = $(git cat-file commit $(git rev-parse HEAD) | grep parent | wc -l)
38 test_expect_success 'pull does a rebase but does not fuck up merges' '
40 echo "$test_name on topic2" >a.topic2 &&
42 git commit -a -m "create topic2" &&
43 git push origin topic2 &&
46 git checkout stable &&
47 echo "$test_name on stable" >a &&
48 git commit -a -m "move stable that will not be replayed" &&
49 git push origin stable &&
51 # And merge stable into topic2
52 git checkout topic2 &&
55 # Move topic2 on the server
57 git checkout topic2 &&
58 echo "$test_name" >a.topic2.server &&
59 git add a.topic2.server &&
60 git commit -m "move topic2 on the server" &&
63 # Merge stable locally too--should conflict
64 git checkout topic2 &&
66 test 1 = $(git rev-list --all --pretty=oneline | grep "replayed" | wc -l)