3 test_description
='tracking branch update checks for git push'
7 test_expect_success
'setup' '
16 git commit -a -m b1 &&
22 test_expect_success
'prepare pushable branches' '
24 b1=$(git rev-parse origin/b1) &&
25 b2=$(git rev-parse origin/b2) &&
26 git checkout -b b1 origin/b1 &&
28 git commit -a -m aa-b1 &&
29 git checkout -b b2 origin/b2 &&
31 git commit -a -m aa-b2 &&
32 git checkout master &&
33 echo aa-master >>file &&
34 git commit -a -m aa-master
37 test_expect_success
'mixed-success push returns error' '! git push'
39 test_expect_success
'check tracking branches updated correctly after push' '
40 test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
43 test_expect_success
'check tracking branches not updated for failed refs' '
44 test "$(git rev-parse origin/b1)" = "$b1" &&
45 test "$(git rev-parse origin/b2)" = "$b2"
48 test_expect_success
'deleted branches have their tracking branches removed' '
49 git push origin :b1 &&
50 test "$(git rev-parse origin/b1)" = "origin/b1"