summaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-04-02 13:10:33 +0530
committerJunio C Hamano <gitster@pobox.com>2013-04-02 10:41:42 -0700
commit224c2171637ee71c36cb6b0ed314d14216725d6f (patch)
tree711aa2f13216d2c8676481515efa11c7ab84a676 /t/t5516-fetch-push.sh
parentf24f715e05399cba19cb9455fdd7d8a9806fe61b (diff)
downloadgit-224c2171637ee71c36cb6b0ed314d14216725d6f.tar.gz
remote.c: introduce remote.pushdefault
This new configuration variable defines the default remote to push to, and overrides `branch.<name>.remote` for all branches. It is useful in the typical triangular-workflow setup, where the remote you're fetching from is different from the remote you're pushing to. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index b800a8ea1b..797b537d8a 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -497,6 +497,18 @@ test_expect_success 'push with config remote.*.push = HEAD' '
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 &&
+ git push &&
+ check_push_result up_repo $the_first_commit heads/master &&
+ check_push_result down_repo $the_commit heads/master
+'
+
test_expect_success 'push with config remote.*.pushurl' '
mk_test testrepo heads/master &&