Skip to content

Commit c68c408

Browse files
committed
t5516: test interaction between pushURL and pushInsteadOf correctly
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 <[email protected]>
1 parent 9a82efd commit c68c408

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t5516-fetch-push.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ test_expect_success 'push with pushInsteadOf' '
230230

231231
test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf should not rewrite)' '
232232
mk_empty &&
233-
TRASH="$(pwd)/" &&
234-
git config "url.trash2/.pushInsteadOf" trash/ &&
233+
git config "url.trash2/.pushInsteadOf" testrepo/ &&
234+
git config "url.trash3/.pusnInsteadOf" trash/wrong &&
235235
git config remote.r.url trash/wrong &&
236-
git config remote.r.pushurl "$TRASH/testrepo" &&
236+
git config remote.r.pushurl "testrepo/" &&
237237
git push r refs/heads/master:refs/remotes/origin/master &&
238238
(
239239
cd testrepo &&

0 commit comments

Comments
 (0)