t5541-http-push: add test for chunked
Trigger the chunked type of pushing for smart HTTP. This can serve as a regression test for the issue fixed in 1e41827 (http: clear POSTFIELDS when initializing a slot). Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tay Ray Chuan committed
May 5, 2011 at 01:19 UTC
0cc6330d0c29dcba062e909543f6adf6872622ad
1 file changed
+16
-2
t/t5541-http-push.sh
+16
-2
@@ -65,14 +65,16 @@ test_expect_success 'clone remote repository' '
65
git clone $HTTPD_URL/smart/test_repo.git test_repo_clone
66
'
67
68
-test_expect_success 'push to remote repository' '
68
+test_expect_success 'push to remote repository (standard)' '
69
cd "$ROOT_PATH"/test_repo_clone &&
70
: >path2 &&
71
git add path2 &&
72
test_tick &&
73
git commit -m path2 &&
74
HEAD=$(git rev-parse --verify HEAD) &&
75
- git push &&
75
+ GIT_CURL_VERBOSE=1 git push -v -v 2>err &&
76
+ ! grep "Expect: 100-continue" err &&
77
+ grep "POST git-receive-pack ([0-9]* bytes)" err &&
78
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
79
test $HEAD = $(git rev-parse --verify HEAD))
80
'
@@ -140,5 +142,17 @@ test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatc
142
output
143
'
144
145
+test_expect_success 'push (chunked)' '
146
+ git checkout master &&
147
+ test_commit commit path3 &&
148
+ HEAD=$(git rev-parse --verify HEAD) &&
149
+ git config http.postbuffer 4 &&
150
+ test_when_finished "git config --unset http.postbuffer" &&
151
+ git push -v -v origin $BRANCH 2>err &&
152
+ grep "POST git-receive-pack (chunked)" err &&
153
+ (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
154
+ test $HEAD = $(git rev-parse --verify HEAD))
155
+'
156
+
157
stop_httpd
158
test_done