summaryrefslogtreecommitdiff
path: root/t/t5581-http-curl-verbose.sh
diff options
context:
space:
mode:
authorMasaya Suzuki <masayasuzuki@google.com>2019-01-10 11:33:50 -0800
committerJunio C Hamano <gitster@pobox.com>2019-01-10 15:00:56 -0800
commite4871cd50c87610469a08b7fa8ef46677d2b8b7b (patch)
tree42737e6f53d315be7ad3709a5b842f4118f1ff01 /t/t5581-http-curl-verbose.sh
parentb79bdd8c1208103f106e9cf7a535b625521b21c9 (diff)
downloadgit-e4871cd50c87610469a08b7fa8ef46677d2b8b7b.tar.gz
test: test GIT_CURL_VERBOSE=1 shows an error
This tests GIT_CURL_VERBOSE shows an error when an URL returns 500. This exercises the code in remote_curl. Signed-off-by: Masaya Suzuki <masayasuzuki@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5581-http-curl-verbose.sh')
-rwxr-xr-xt/t5581-http-curl-verbose.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
new file mode 100755
index 0000000000..cd9283eeec
--- /dev/null
+++ b/t/t5581-http-curl-verbose.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+test_description='test GIT_CURL_VERBOSE'
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success 'setup repository' '
+ mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" --bare init &&
+ git config push.default matching &&
+ echo content >file &&
+ git add file &&
+ git commit -m one &&
+ git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git push public master:master
+'
+
+test_expect_success 'failure in git-upload-pack is shown' '
+ test_might_fail env GIT_CURL_VERBOSE=1 \
+ git clone "$HTTPD_URL/error_git_upload_pack/smart/repo.git" \
+ 2>curl_log &&
+ grep "< HTTP/1.1 500 Intentional Breakage" curl_log
+'
+
+stop_httpd
+
+test_done