3 test_description='script pull'
7 export PATH=$PATH:../../scripts
9 test_expect_success 'setup' '
12 git commit -m "setup" &&
13 git clone -l . --bare server.git &&
14 rm -fr server.git/hooks &&
15 git remote add origin ./server.git &&
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
27 git clone server.git person2 &&
29 git checkout topic1 &&
30 echo "$test_name" >a &&
31 git commit -a -m "move topic1 on the server" &&
37 test 1 = $(git cat-file commit $(git rev-parse HEAD) | grep parent | wc -l)
40 test_expect_success 'pull does a rebase but does not fuck up merges' '
42 echo "$test_name on topic2" >a.topic2 &&
44 git commit -a -m "create topic2" &&
45 git push origin topic2 &&
48 git checkout stable &&
49 echo "$test_name on stable" >a &&
50 git commit -a -m "move stable that will not be replayed" &&
51 git push origin stable &&
53 # And merge stable into topic2
54 git checkout topic2 &&
57 # Move topic2 on the server
60 git checkout -b topic2 origin/topic2 &&
61 echo "$test_name" >a.topic2.server &&
62 git add a.topic2.server &&
63 git commit -m "move topic2 on the server" &&
67 # Merge stable locally too--should conflict
68 git checkout topic2 &&
70 test 1 = $(git rev-list --all --pretty=oneline | grep "replayed" | wc -l) &&
74 test_expect_success 'pull moves when we have no local changes' '
75 git checkout topic2 &&
77 # Move topic2 on the server
80 echo "$test_name" > a.topic2.server &&
81 git commit -a -m "move topic2 on the server" &&
86 test $(git rev-parse HEAD) = $(git rev-parse origin/topic2)