From e1ca424112d5e8923a4a83af0f79eadbff088b69 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 9 Jun 2009 18:01:35 +0200 Subject: t5516: Check pushurl config setting Check whether the new remote.${remotename}.pushurl setting is obeyed and whether it overrides remote.${remotename}.url. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- t/t5516-fetch-push.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 't') diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 89649e7a9b..2d2633f3f8 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -419,6 +419,19 @@ test_expect_success 'push with config remote.*.push = HEAD' ' git config --remove-section remote.there git config --remove-section branch.master +test_expect_success 'push with config remote.*.pushurl' ' + + mk_test heads/master && + git checkout master && + git config remote.there.url test2repo && + git config remote.there.pushurl testrepo && + git push there && + check_push_result $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 && -- cgit v1.2.3 From 857f8c30d79ce15b6110b0df9d3ad87075ca5153 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Sat, 13 Jun 2009 18:29:10 +0200 Subject: builtin-remote: Show push urls as well Teach builtin remote to show push urls also when asked to "show" a specific remote. This improves upon the standard display mode: multiple specified "url"s mean that the first one is for fetching, all are used for pushing. We make this clearer now by displaying the first one prefixed with "Fetch URL", and all "url"s (or, if present, all "pushurl"s) prefixed with "Push URL". Example with "one" having one url, "two" two urls, "three" one url and one pushurl (URL part only): * remote one Fetch URL: hostone.com:/somepath/repoone.git Push URL: hostone.com:/somepath/repoone.git * remote two Fetch URL: hosttwo.com:/somepath/repotwo.git Push URL: hosttwo.com:/somepath/repotwo.git Push URL: hosttwobackup.com:/somewheresafe/repotwo.git * remote three Fetch URL: http://hostthree.com/otherpath/repothree.git Push URL: hostthree.com:/pathforpushes/repothree.git Also, adjust t5505 accordingly and make it test for the new output. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- t/t5505-remote.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index e70246b3fb..852ccb5d7d 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -135,7 +135,8 @@ EOF cat > test/expect << EOF * remote origin - URL: $(pwd)/one + Fetch URL: $(pwd)/one + Push URL: $(pwd)/one HEAD branch: master Remote branches: master new (next fetch will store in remotes/origin) @@ -151,7 +152,8 @@ cat > test/expect << EOF master pushes to master (local out of date) master pushes to upstream (create) * remote two - URL: ../two + Fetch URL: ../two + Push URL: ../three HEAD branch (remote HEAD is ambiguous, may be one of the following): another master @@ -173,6 +175,7 @@ test_expect_success 'show' ' git branch --track rebase origin/master && git branch -d -r origin/master && git config --add remote.two.url ../two && + git config --add remote.two.pushurl ../three && git config branch.rebase.rebase true && git config branch.octopus.merge "topic-a topic-b topic-c" && (cd ../one && @@ -191,7 +194,8 @@ test_expect_success 'show' ' cat > test/expect << EOF * remote origin - URL: $(pwd)/one + Fetch URL: $(pwd)/one + Push URL: $(pwd)/one HEAD branch: (not queried) Remote branches: (status not queried) master -- cgit v1.2.3