http: treat http-alternates like redirects
[gitweb.git] / t / t5551-http-fetch-smart.sh
index 43b257e7fd20e8e2e9f37aab74e863765578de29..d8826acde69337a2ffab35aedc12a07d75d508e4 100755 (executable)
@@ -110,6 +110,10 @@ test_expect_success 'redirects re-root further requests' '
        git clone $HTTPD_URL/smart-redir-limited/repo.git repo-redir-limited
 '
 
+test_expect_success 're-rooting dies on insane schemes' '
+       test_must_fail git clone $HTTPD_URL/insane-redir/repo.git insane
+'
+
 test_expect_success 'clone from password-protected repository' '
        echo two >expect &&
        set_askpass user@host pass@host &&
@@ -287,7 +291,16 @@ test_expect_success 'custom http headers' '
                fetch "$HTTPD_URL/smart_headers/repo.git" &&
        git -c http.extraheader="x-magic-one: abra" \
            -c http.extraheader="x-magic-two: cadabra" \
-           fetch "$HTTPD_URL/smart_headers/repo.git"
+           fetch "$HTTPD_URL/smart_headers/repo.git" &&
+       git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
+       git config -f .gitmodules submodule.sub.path sub &&
+       git config -f .gitmodules submodule.sub.url \
+               "$HTTPD_URL/smart_headers/repo.git" &&
+       git submodule init sub &&
+       test_must_fail git submodule update sub &&
+       git -c http.extraheader="x-magic-one: abra" \
+           -c http.extraheader="x-magic-two: cadabra" \
+               submodule update sub
 '
 
 stop_httpd