summaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-10 08:52:45 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-10 08:52:45 -0800
commit84d52cabe7044786b5cc448ffeb97b7c1e667156 (patch)
tree2f57895a2c3dc9e781696c8b33b5593358a4aaea /t/t5516-fetch-push.sh
parent9c787f3f88f077ad23498cf03b1b57ac3bd41b33 (diff)
parentf517f1f2e9c9e3abe0fde1b3c9a7bb20fdb5ba55 (diff)
downloadgit-84d52cabe7044786b5cc448ffeb97b7c1e667156.tar.gz
Merge branch 'jk/push-to-delete'
* jk/push-to-delete: builtin-push: add --delete as syntactic sugar for :foo
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 516127b539..0f04b2e894 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -547,6 +547,32 @@ test_expect_success 'allow deleting an invalid remote ref' '
'
+test_expect_success 'allow deleting a ref using --delete' '
+ mk_test heads/master &&
+ (cd testrepo && git config receive.denyDeleteCurrent warn) &&
+ git push testrepo --delete master &&
+ (cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+'
+
+test_expect_success 'allow deleting a tag using --delete' '
+ mk_test heads/master &&
+ git tag -a -m dummy_message deltag heads/master &&
+ git push testrepo --tags &&
+ (cd testrepo && git rev-parse --verify -q refs/tags/deltag) &&
+ git push testrepo --delete tag deltag &&
+ (cd testrepo && test_must_fail git rev-parse --verify refs/tags/deltag)
+'
+
+test_expect_success 'push --delete without args aborts' '
+ mk_test heads/master &&
+ test_must_fail git push testrepo --delete
+'
+
+test_expect_success 'push --delete refuses src:dest refspecs' '
+ mk_test heads/master &&
+ test_must_fail git push testrepo --delete master:foo
+'
+
test_expect_success 'warn on push to HEAD of non-bare repository' '
mk_test heads/master
(cd testrepo &&