t5551-http-fetch: Work around some libcurl versions

Some versions of libcurl report their output when GIT_CURL_VERBOSE
is set differently than other versions do.  At least one variant
(version unknown but likely pre-7.18.1) reports the POST payload to
stderr, and omits the blank line after each HTTP request/response.
We clip these lines out of the stderr output now before doing the
compare, so we aren't surprised by this trivial difference.

Reported-by: Tarmigan <tarmigan+git@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Shawn O. Pearce 2009-11-09 10:10:36 -08:00 committed by Junio C Hamano
parent 34b6cb8bb0
commit 0a8fcbdca2

View File

@ -31,23 +31,19 @@ cat >exp <<EOF
> GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
> Accept: */* > Accept: */*
> Pragma: no-cache > Pragma: no-cache
< HTTP/1.1 200 OK < HTTP/1.1 200 OK
< Pragma: no-cache < Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate < Cache-Control: no-cache, max-age=0, must-revalidate
< Content-Type: application/x-git-upload-pack-advertisement < Content-Type: application/x-git-upload-pack-advertisement
<
> POST /smart/repo.git/git-upload-pack HTTP/1.1 > POST /smart/repo.git/git-upload-pack HTTP/1.1
> Accept-Encoding: deflate, gzip > Accept-Encoding: deflate, gzip
> Content-Type: application/x-git-upload-pack-request > Content-Type: application/x-git-upload-pack-request
> Accept: application/x-git-upload-pack-response > Accept: application/x-git-upload-pack-response
> Content-Length: xxx > Content-Length: xxx
< HTTP/1.1 200 OK < HTTP/1.1 200 OK
< Pragma: no-cache < Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate < Cache-Control: no-cache, max-age=0, must-revalidate
< Content-Type: application/x-git-upload-pack-result < Content-Type: application/x-git-upload-pack-result
<
EOF EOF
test_expect_success 'clone http repository' ' test_expect_success 'clone http repository' '
GIT_CURL_VERBOSE=1 git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && GIT_CURL_VERBOSE=1 git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&
@ -56,6 +52,8 @@ test_expect_success 'clone http repository' '
sed -e " sed -e "
s/Q\$// s/Q\$//
/^[*] /d /^[*] /d
/^$/d
/^< $/d
/^[^><]/{ /^[^><]/{
s/^/> / s/^/> /
@ -64,6 +62,8 @@ test_expect_success 'clone http repository' '
/^> User-Agent: /d /^> User-Agent: /d
/^> Host: /d /^> Host: /d
s/^> Content-Length: .*/> Content-Length: xxx/ s/^> Content-Length: .*/> Content-Length: xxx/
/^> 00..want /d
/^> 00.*done/d
/^< Server: /d /^< Server: /d
/^< Expires: /d /^< Expires: /d