3 test_description='tracking branch update checks for git push'
7 test_expect_success 'setup' '
17 git commit -a -m b1 &&
23 test_expect_success 'prepare pushable branches' '
25 b1=$(git rev-parse origin/b1) &&
26 b2=$(git rev-parse origin/b2) &&
27 git checkout -b b1 origin/b1 &&
29 git commit -a -m aa-b1 &&
30 git checkout -b b2 origin/b2 &&
32 git commit -a -m aa-b2 &&
33 git checkout master &&
34 echo aa-master >>file &&
35 git commit -a -m aa-master
38 test_expect_success 'mixed-success push returns error' '
39 test_must_fail git push
42 test_expect_success 'check tracking branches updated correctly after push' '
43 test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
46 test_expect_success 'check tracking branches not updated for failed refs' '
47 test "$(git rev-parse origin/b1)" = "$b1" &&
48 test "$(git rev-parse origin/b2)" = "$b2"
51 test_expect_success 'deleted branches have their tracking branches removed' '
52 git push origin :b1 &&
53 test "$(git rev-parse origin/b1)" = "origin/b1"
56 test_expect_success 'already deleted tracking branches ignored' '
57 git branch -d -r origin/b3 &&
58 git push origin :b3 >output 2>&1 &&