Skip to content

Commit

Permalink
t5516: test interaction between pushURL and pushInsteadOf correctly
Browse files Browse the repository at this point in the history
1c2eafb (Add url.<base>.pushInsteadOf: URL rewriting for push
only, 2009-09-07) wants to make sure that a push destination read
from URL is not rewritten by pushInsteadOf because an explicit
pushURL exists; for that, a pushInsteadOf rewrite rule for the value
of remote.r.URL is set to a non-existent is set up.

We would also want to make sure that pushInsteadOf rewrite rule is
not applied to the location read from pushURL.

This way, we will make sure that

 - "testrepo/" (pushURL) gets updated;

 - the push does not try to update "trash2/" (the result of applying
   pushInsteadOf to pushURL);

 - the push does not try to update "trash3/" (the result of applying
   pushInsteadOf to URL).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 28, 2013
1 parent 9a82efd commit c68c408
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ test_expect_success 'push with pushInsteadOf' '

test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf should not rewrite)' '
mk_empty &&
TRASH="$(pwd)/" &&
git config "url.trash2/.pushInsteadOf" trash/ &&
git config "url.trash2/.pushInsteadOf" testrepo/ &&
git config "url.trash3/.pusnInsteadOf" trash/wrong &&
git config remote.r.url trash/wrong &&
git config remote.r.pushurl "$TRASH/testrepo" &&
git config remote.r.pushurl "testrepo/" &&
git push r refs/heads/master:refs/remotes/origin/master &&
(
cd testrepo &&
Expand Down

0 comments on commit c68c408

Please sign in to comment.