diff options
Diffstat (limited to 't/t5560-http-backend-noserver.sh')
-rwxr-xr-x | t/t5560-http-backend-noserver.sh | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh index 44885b850c..9fafcf1945 100755 --- a/t/t5560-http-backend-noserver.sh +++ b/t/t5560-http-backend-noserver.sh @@ -5,18 +5,23 @@ test_description='test git-http-backend-noserver' HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY" +if test_have_prereq GREP_STRIPS_CR +then + GREP_OPTIONS=-U + export GREP_OPTIONS +fi + run_backend() { echo "$2" | - QUERY_STRING="${1#*\?}" \ - GIT_PROJECT_ROOT="$HTTPD_DOCUMENT_ROOT_PATH" \ - PATH_INFO="${1%%\?*}" \ + QUERY_STRING="${1#*[?]}" \ + PATH_TRANSLATED="$HTTPD_DOCUMENT_ROOT_PATH/${1%%[?]*}" \ git http-backend >act.out 2>act.err } GET() { - export REQUEST_METHOD="GET" && + REQUEST_METHOD="GET" && export REQUEST_METHOD && run_backend "/repo.git/$1" && - unset REQUEST_METHOD && + sane_unset REQUEST_METHOD && if ! grep "Status" act.out >act then printf "Status: 200 OK\r\n" >act @@ -26,11 +31,11 @@ GET() { } POST() { - export REQUEST_METHOD="POST" && - export CONTENT_TYPE="application/x-$1-request" && + REQUEST_METHOD="POST" && export REQUEST_METHOD && + CONTENT_TYPE="application/x-$1-request" && export CONTENT_TYPE && run_backend "/repo.git/$1" "$2" && - unset REQUEST_METHOD && - unset CONTENT_TYPE && + sane_unset REQUEST_METHOD && + sane_unset CONTENT_TYPE && if ! grep "Status" act.out >act then printf "Status: 200 OK\r\n" >act @@ -39,14 +44,10 @@ POST() { test_cmp exp act } -log_div() { - return 0 -} - . "$TEST_DIRECTORY"/t556x_common expect_aliased() { - export REQUEST_METHOD="GET" && + REQUEST_METHOD="GET" && export REQUEST_METHOD && if test $1 = 0; then run_backend "$2" else |