summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-09 04:44:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-09 04:44:51 (GMT)
commitfd357c4270ea4b48e95fb475fdc9b6ce2ee447e1 (patch)
tree77630863e8b1fc6b42536e1945213922e2ee1c76 /t
parent5a5f40881d6dcebec36190115779eeb4ae89b6c9 (diff)
parent30dea56536e78ad8a9533d51ad1d8c9c85c3c7bd (diff)
downloadgit-fd357c4270ea4b48e95fb475fdc9b6ce2ee447e1.zip
git-fd357c4270ea4b48e95fb475fdc9b6ce2ee447e1.tar.gz
git-fd357c4270ea4b48e95fb475fdc9b6ce2ee447e1.tar.bz2
Merge branch 'js/smart-http-detect-remote-error'
Some errors from the other side coming over smart HTTP transport were not noticed, which has been corrected. * js/smart-http-detect-remote-error: t5551: test server-side ERR packet remote-curl: tighten "version 2" check for smart-http remote-curl: refactor smart-http discovery
Diffstat (limited to 't')
-rw-r--r--t/lib-httpd.sh1
-rw-r--r--t/lib-httpd/apache.conf4
-rw-r--r--t/lib-httpd/error-smart-http.sh3
-rwxr-xr-xt/t5551-http-fetch-smart.sh5
4 files changed, 13 insertions, 0 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index e465116..216281e 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -131,6 +131,7 @@ prepare_httpd() {
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
install_script broken-smart-http.sh
+ install_script error-smart-http.sh
install_script error.sh
install_script apply-one-time-sed.sh
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 5d63ed9..06a81b5 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -119,6 +119,7 @@ Alias /auth/dumb/ www/auth/dumb/
ScriptAliasMatch /error_git_upload_pack/(.*)/git-upload-pack error.sh/
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
ScriptAlias /broken_smart/ broken-smart-http.sh/
+ScriptAlias /error_smart/ error-smart-http.sh/
ScriptAlias /error/ error.sh/
ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
<Directory ${GIT_EXEC_PATH}>
@@ -127,6 +128,9 @@ ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
<Files broken-smart-http.sh>
Options ExecCGI
</Files>
+<Files error-smart-http.sh>
+ Options ExecCGI
+</Files>
<Files error.sh>
Options ExecCGI
</Files>
diff --git a/t/lib-httpd/error-smart-http.sh b/t/lib-httpd/error-smart-http.sh
new file mode 100644
index 0000000..e65d447
--- /dev/null
+++ b/t/lib-httpd/error-smart-http.sh
@@ -0,0 +1,3 @@
+echo "Content-Type: application/x-git-upload-pack-advertisement"
+echo
+printf "%s" "0019ERR server-side error"
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 8630b0c..ba83e56 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -429,5 +429,10 @@ test_expect_success 'GIT_TRACE_CURL_NO_DATA prevents data from being traced' '
! grep "=> Send data" err
'
+test_expect_success 'server-side error detected' '
+ test_must_fail git clone $HTTPD_URL/error_smart/repo.git 2>actual &&
+ grep "server-side error" actual
+'
+
stop_httpd
test_done