3 test_description='server update tags in branch check'
7 test_expect_success 'setup' '
10 git commit -m "setup" &&
11 git clone ./. server &&
12 rm -fr server/.git/hooks &&
13 git remote add origin ./server
16 install_update_hook 'update-ensure-tag-in-branch'
18 test_expect_success 'push only tag fails' '
19 echo "$test_name" >a &&
20 git commit -a -m "$test_name moved master" &&
21 git tag -a -m "tagged move as r1" r1 &&
22 ! git push --tags 2>push.err &&
23 cat push.err | grep "The tag r1 is not included in any branch." &&
25 # But now it works if we push the commit first
30 test_expect_success 'push works if done at the same time' '
31 echo "$test_name" >a &&
32 git commit -a -m "$test_name moved master" &&
33 git tag -a -m "tagged move as r2" r2 &&
34 git push origin master r2
37 test_expect_success 'moving branch back and deleting tag works' '
38 git reset --hard HEAD^ &&
39 git push --force origin master:master :r2