@matheusbsbs / matheus-bagliano / commits / 0a8fcbdca2
Fork 0

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>

Shawn O. Pearce committed Nov 9, 2009 at 10:10 UTC 0a8fcbdca28f6c8dad3cac9aca48f866c84b0f11
1 file changed +4 -4
t/t5551-http-fetch.sh
+4 -4
@@ -31,23 +31,19 @@ cat >exp <<EOF
31 > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
32 > Accept: */*
33 > Pragma: no-cache
34 -
34 < HTTP/1.1 200 OK
35 < Pragma: no-cache
36 < Cache-Control: no-cache, max-age=0, must-revalidate
37 < Content-Type: application/x-git-upload-pack-advertisement
39 -<
38 > POST /smart/repo.git/git-upload-pack HTTP/1.1
39 > Accept-Encoding: deflate, gzip
40 > Content-Type: application/x-git-upload-pack-request
41 > Accept: application/x-git-upload-pack-response
42 > Content-Length: xxx
45 -
43 < HTTP/1.1 200 OK
44 < Pragma: no-cache
45 < Cache-Control: no-cache, max-age=0, must-revalidate
46 < Content-Type: application/x-git-upload-pack-result
50 -<
47 EOF
48 test_expect_success 'clone http repository' '
49 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' '
52 sed -e "
53 s/Q\$//
54 /^[*] /d
55 + /^$/d
56 + /^< $/d
57
58 /^[^><]/{
59 s/^/> /
@@ -64,6 +62,8 @@ test_expect_success 'clone http repository' '
62 /^> User-Agent: /d
63 /^> Host: /d
64 s/^> Content-Length: .*/> Content-Length: xxx/
65 + /^> 00..want /d
66 + /^> 00.*done/d
67
68 /^< Server: /d
69 /^< Expires: /d