ref-filter: add --no-contains option to tag/branch/for-each-ref
[gitweb.git] / t / t5550-http-fetch-dumb.sh
index d66ef43cb742f366f074ab28f3dc4b56a73149c9..b69ece1d66f2b076ff94904dc7fddb7c7c1c88c5 100755 (executable)
@@ -377,5 +377,15 @@ test_expect_success 'http-alternates cannot point at funny protocols' '
                clone "$HTTPD_URL/dumb/evil.git" evil-file
 '
 
+test_expect_success 'http-alternates triggers not-from-user protocol check' '
+       echo "$HTTPD_URL/dumb/victim.git/objects" \
+               >"$evil/objects/info/http-alternates" &&
+       test_config_global http.followRedirects true &&
+       test_must_fail git -c protocol.http.allow=user \
+               clone $HTTPD_URL/dumb/evil.git evil-user &&
+       git -c protocol.http.allow=always \
+               clone $HTTPD_URL/dumb/evil.git evil-user
+'
+
 stop_httpd
 test_done