]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5516-fetch-push.sh
Add support for url aliases in config files
[thirdparty/git.git] / t / t5516-fetch-push.sh
index 9d2dc33cbd0d1df19b0a9003e545104a982da694..9023ba05af6b6fc6023fe0213b6798a3d7408750 100755 (executable)
@@ -100,6 +100,23 @@ test_expect_success 'fetch with wildcard' '
        )
 '
 
+test_expect_success 'fetch with insteadOf' '
+       mk_empty &&
+       (
+               TRASH=$(pwd) &&
+               cd testrepo &&
+               git config url./$TRASH/.insteadOf trash/
+               git config remote.up.url trash/. &&
+               git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
+               git fetch up &&
+
+               r=$(git show-ref -s --verify refs/remotes/origin/master) &&
+               test "z$r" = "z$the_commit" &&
+
+               test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
+       )
+'
+
 test_expect_success 'push without wildcard' '
        mk_empty &&
 
@@ -126,6 +143,20 @@ test_expect_success 'push with wildcard' '
        )
 '
 
+test_expect_success 'push with insteadOf' '
+       mk_empty &&
+       TRASH=$(pwd) &&
+       git config url./$TRASH/.insteadOf trash/ &&
+       git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+       (
+               cd testrepo &&
+               r=$(git show-ref -s --verify refs/remotes/origin/master) &&
+               test "z$r" = "z$the_commit" &&
+
+               test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
+       )
+'
+
 test_expect_success 'push with matching heads' '
 
        mk_test heads/master &&