From: Junio C Hamano Date: Fri, 26 Feb 2021 00:43:32 +0000 (-0800) Subject: Merge branch 'jc/push-delete-nothing' X-Git-Tag: v2.31.0-rc0~1 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgit.git;a=commitdiff_plain;h=140045821aa78da3a80a7d7c8f707b955e1ab40d Merge branch 'jc/push-delete-nothing' "git push $there --delete ''" should have been diagnosed as an error, but instead turned into a matching push, which has been corrected. * jc/push-delete-nothing: push: do not turn --delete '' into a matching push --- 140045821aa78da3a80a7d7c8f707b955e1ab40d diff --cc t/t5516-fetch-push.sh index 15262b4192,bf0d295d80..f11742ed59 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@@ -816,18 -814,23 +816,23 @@@ test_expect_success 'push --delete with ' test_expect_success 'push --delete refuses src:dest refspecs' ' - mk_test testrepo heads/master && - test_must_fail git push testrepo --delete master:foo + mk_test testrepo heads/main && + test_must_fail git push testrepo --delete main:foo ' + test_expect_success 'push --delete refuses empty string' ' + mk_test testrepo heads/master && + test_must_fail git push testrepo --delete "" + ' + test_expect_success 'warn on push to HEAD of non-bare repository' ' - mk_test testrepo heads/master && + mk_test testrepo heads/main && ( cd testrepo && - git checkout master && + git checkout main && git config receive.denyCurrentBranch warn ) && - git push testrepo master 2>stderr && + git push testrepo main 2>stderr && grep "warning: updating the current branch" stderr '