35
test_expect_success 'clone http repository' '
36
cat >exp <<-\EOF &&
37
> GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
38
- > Accept: */*
39
- > Accept-Encoding: ENCODINGS
40
- > Accept-Language: ko-KR, *;q=0.9
41
- > Pragma: no-cache
38
+ > accept: */*
39
+ > accept-encoding: ENCODINGS
40
+ > accept-language: ko-KR, *;q=0.9
41
+ > pragma: no-cache
42
< HTTP/1.1 200 OK
43
- < Pragma: no-cache
44
- < Cache-Control: no-cache, max-age=0, must-revalidate
45
- < Content-Type: application/x-git-upload-pack-advertisement
43
+ < pragma: no-cache
44
+ < cache-control: no-cache, max-age=0, must-revalidate
45
+ < content-type: application/x-git-upload-pack-advertisement
46
> POST /smart/repo.git/git-upload-pack HTTP/1.1
47
- > Accept-Encoding: ENCODINGS
48
- > Content-Type: application/x-git-upload-pack-request
49
- > Accept: application/x-git-upload-pack-result
50
- > Accept-Language: ko-KR, *;q=0.9
51
- > Content-Length: xxx
47
+ > accept-encoding: ENCODINGS
48
+ > content-type: application/x-git-upload-pack-request
49
+ > accept: application/x-git-upload-pack-result
50
+ > accept-language: ko-KR, *;q=0.9
51
+ > content-length: xxx
52
< HTTP/1.1 200 OK
53
- < Pragma: no-cache
54
- < Cache-Control: no-cache, max-age=0, must-revalidate
55
- < Content-Type: application/x-git-upload-pack-result
53
+ < pragma: no-cache
54
+ < cache-control: no-cache, max-age=0, must-revalidate
55
+ < content-type: application/x-git-upload-pack-result
56
EOF
57
58
GIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION=0 LANGUAGE="ko_KR.UTF-8" \
59
git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&
60
test_cmp file clone/file &&
61
tr '\''\015'\'' Q <err |
62
+ perl -pe '\''
63
+ s/(Send|Recv) header: ([A-Za-z0-9-]+):/
64
+ "$1 header: " . lc($2) . ":"
65
+ /e;
66
+ '\'' |
67
sed -e "
68
s/Q\$//
69
/^[*] /d
83
s/^/> /
84
}
85
81
- /^> User-Agent: /d
82
- /^> Host: /d
86
+ /^> user-agent: /d
87
+ /^> host: /d
88
/^> POST /,$ {
89
/^> Accept: [*]\\/[*]/d
90
}
86
- s/^> Content-Length: .*/> Content-Length: xxx/
91
+ s/^> content-length: .*/> content-length: xxx/
92
/^> 00..want /d
93
/^> 00.*done/d
94
90
- /^< Server: /d
91
- /^< Expires: /d
92
- /^< Date: /d
93
- /^< Content-Length: /d
94
- /^< Transfer-Encoding: /d
95
+ /^< server: /d
96
+ /^< expires: /d
97
+ /^< date: /d
98
+ /^< content-length: /d
99
+ /^< transfer-encoding: /d
100
" >actual &&
101
102
# NEEDSWORK: If the overspecification of the expected result is reduced, we
103
# might be able to run this test in all protocol versions.
104
if test "$GIT_TEST_PROTOCOL_VERSION" = 0
105
then
101
- sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \
106
+ sed -e "s/^> accept-encoding: .*/> accept-encoding: ENCODINGS/" \
107
actual >actual.smudged &&
108
test_cmp exp actual.smudged &&
109
105
- grep "Accept-Encoding:.*gzip" actual >actual.gzip &&
110
+ grep "accept-encoding:.*gzip" actual >actual.gzip &&
111
test_line_count = 2 actual.gzip
112
fi
113
'