3 test_description
="test fetching through http proxy"
5 TEST_PASSES_SANITIZE_LEAK
=true
7 .
"$TEST_DIRECTORY"/lib-httpd.sh
12 test_expect_success
'setup repository' '
14 git init --bare "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
15 git push --mirror "$HTTPD_DOCUMENT_ROOT_PATH/repo.git"
20 # sanity check that our test setup is correctly using proxy
21 test_expect_success
'proxy requires password' '
22 test_config_global http.proxy $HTTPD_DEST &&
23 test_must_fail git clone $HTTPD_URL/smart/repo.git 2>err &&
27 test_expect_success
'clone through proxy with auth' '
28 test_when_finished "rm -rf clone" &&
29 test_config_global http.proxy http://proxuser:proxpass@$HTTPD_DEST &&
30 GIT_TRACE_CURL=$PWD/trace git clone $HTTPD_URL/smart/repo.git clone &&
31 grep -i "Proxy-Authorization: Basic <redacted>" trace
34 test_expect_success
'clone can prompt for proxy password' '
35 test_when_finished "rm -rf clone" &&
36 test_config_global http.proxy http://proxuser@$HTTPD_DEST &&
37 set_askpass nobody proxpass &&
38 GIT_TRACE_CURL=$PWD/trace git clone $HTTPD_URL/smart/repo.git clone &&
39 expect_askpass pass proxuser