From: Junio C Hamano Date: Thu, 18 Apr 2013 18:47:59 +0000 (-0700) Subject: Merge branch 'jc/push-2.0-default-to-simple' (early part) X-Git-Tag: v1.8.3-rc0~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=54a3c67375384a38eae946b7996d226dbd9c26d4;p=thirdparty%2Fgit.git Merge branch 'jc/push-2.0-default-to-simple' (early part) Adjust our tests for upcoming migration of the default value for the "push.default" configuration variable to "simple" from "mixed". * 'jc/push-2.0-default-to-simple' (early part): t5570: do not assume the "matching" push is the default t5551: do not assume the "matching" push is the default t5550: do not assume the "matching" push is the default t9401: do not assume the "matching" push is the default t9400: do not assume the "matching" push is the default t7406: do not assume the "matching" push is the default t5531: do not assume the "matching" push is the default t5519: do not assume the "matching" push is the default t5517: do not assume the "matching" push is the default t5516: do not assume the "matching" push is the default t5505: do not assume the "matching" push is the default t5404: do not assume the "matching" push is the default --- 54a3c67375384a38eae946b7996d226dbd9c26d4 diff --cc t/t5516-fetch-push.sh index 838e71dafe,1a8753d2eb..4691d51b8c --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@@ -251,9 -246,9 +251,9 @@@ test_expect_success 'push with pushInst test_expect_success 'push with matching heads' ' - mk_test heads/master && + mk_test testrepo heads/master && - git push testrepo && + git push testrepo : && - check_push_result $the_commit heads/master + check_push_result testrepo $the_commit heads/master ' @@@ -278,11 -273,11 +278,11 @@@ test_expect_success 'failed (non-fast-f test_expect_success 'push --force with matching heads' ' - mk_test heads/master && + mk_test testrepo heads/master && git push testrepo : && git commit --amend -massaged && - git push --force testrepo && + git push --force testrepo : && - ! check_push_result $the_commit heads/master && + ! check_push_result testrepo $the_commit heads/master && git reset --hard $the_commit ' @@@ -489,60 -489,40 +489,62 @@@ test_expect_success 'push with config r git checkout local && git reset --hard $the_first_commit ) && - git config remote.there.url testrepo && - git config remote.there.push HEAD && - git config branch.master.remote there && + test_config remote.there.url testrepo && + test_config remote.there.push HEAD && + test_config branch.master.remote there && + git push && + check_push_result testrepo $the_commit heads/master && + check_push_result testrepo $the_first_commit heads/local +' + +test_expect_success 'push with remote.pushdefault' ' + mk_test up_repo heads/master && + mk_test down_repo heads/master && + test_config remote.up.url up_repo && + test_config remote.down.url down_repo && + test_config branch.master.remote up && + test_config remote.pushdefault down && ++ test_config push.default matching && git push && - check_push_result $the_commit heads/master && - check_push_result $the_first_commit heads/local + check_push_result up_repo $the_first_commit heads/master && + check_push_result down_repo $the_commit heads/master ' -# clean up the cruft left with the previous one -git config --remove-section remote.there -git config --remove-section branch.master - test_expect_success 'push with config remote.*.pushurl' ' - mk_test heads/master && + mk_test testrepo heads/master && git checkout master && - git config remote.there.url test2repo && - git config remote.there.pushurl testrepo && + test_config remote.there.url test2repo && + test_config remote.there.pushurl testrepo && - git push there && + git push there : && - check_push_result $the_commit heads/master + check_push_result testrepo $the_commit heads/master +' + +test_expect_success 'push with config branch.*.pushremote' ' + mk_test up_repo heads/master && + mk_test side_repo heads/master && + mk_test down_repo heads/master && + test_config remote.up.url up_repo && + test_config remote.pushdefault side_repo && + test_config remote.down.url down_repo && + test_config branch.master.remote up && + test_config branch.master.pushremote down && ++ test_config push.default matching && + git push && + check_push_result up_repo $the_first_commit heads/master && + check_push_result side_repo $the_first_commit heads/master && + check_push_result down_repo $the_commit heads/master ' -# clean up the cruft left with the previous one -git config --remove-section remote.there - test_expect_success 'push with dry-run' ' - mk_test heads/master && + mk_test testrepo heads/master && ( cd testrepo && old_commit=$(git show-ref -s --verify refs/heads/master) ) && - git push --dry-run testrepo && + git push --dry-run testrepo : && - check_push_result $old_commit heads/master + check_push_result testrepo $old_commit heads/master ' test_expect_success 'push updates local refs' ' @@@ -1021,11 -980,11 +1023,11 @@@ test_expect_success 'push --porcelain - ' test_expect_success 'push --prune' ' - mk_test heads/master heads/second heads/foo heads/bar && + mk_test testrepo heads/master heads/second heads/foo heads/bar && - git push --prune testrepo && + git push --prune testrepo : && - check_push_result $the_commit heads/master && - check_push_result $the_first_commit heads/second && - ! check_push_result $the_first_commit heads/foo heads/bar + check_push_result testrepo $the_commit heads/master && + check_push_result testrepo $the_first_commit heads/second && + ! check_push_result testrepo $the_first_commit heads/foo heads/bar ' test_expect_success 'push --prune refspec' '