3 test_description
='test disabling of git-over-http in clone/fetch'
5 .
"$TEST_DIRECTORY/lib-proto-disable.sh"
6 .
"$TEST_DIRECTORY/lib-httpd.sh"
9 test_expect_success
'create git-accessible repo' '
10 bare="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
12 git --bare init "$bare" &&
13 git push "$bare" HEAD &&
14 git -C "$bare" config http.receivepack true
17 test_proto
"smart http" http
"$HTTPD_URL/smart/repo.git"
19 test_expect_success
'http(s) transport respects GIT_ALLOW_PROTOCOL' '
20 test_must_fail env GIT_ALLOW_PROTOCOL=http:https \
22 git clone "$HTTPD_URL/ftp-redir/repo.git" 2>stderr &&
23 test_grep -E "(ftp.*disabled|your curl version is too old)" stderr
26 test_expect_success
'curl limits redirects' '
27 test_must_fail git clone "$HTTPD_URL/loop-redir/smart/repo.git"
30 test_expect_success
'http can be limited to from-user' '
31 git -c protocol.http.allow=user \
32 clone "$HTTPD_URL/smart/repo.git" plain.git &&
33 test_must_fail git -c protocol.http.allow=user \
34 clone "$HTTPD_URL/smart-redir-perm/repo.git" redir.git