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@xxxxxxxxx> --- New. t/t5541-http-push.sh | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index 0492877..f589221 100755 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@ -65,14 +65,16 @@ test_expect_success 'clone remote repository' ' git clone $HTTPD_URL/smart/test_repo.git test_repo_clone ' -test_expect_success 'push to remote repository' ' +test_expect_success 'push to remote repository (standard)' ' cd "$ROOT_PATH"/test_repo_clone && : >path2 && git add path2 && test_tick && git commit -m path2 && HEAD=$(git rev-parse --verify HEAD) && - git push && + GIT_CURL_VERBOSE=1 git push -v -v 2>err && + ! grep "Expect: 100-continue" err && + grep "POST git-receive-pack (376 bytes)" err && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && test $HEAD = $(git rev-parse --verify HEAD)) ' @@ -140,5 +142,27 @@ test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatc output ' +test_expect_success 'push (chunked)' ' + BRANCH=master-chunked && + REPO=test_repo_chunked && + + (cd "$HTTPD_DOCUMENT_ROOT_PATH" && + cp -R test_repo.git $REPO) && + git remote set-url origin $HTTPD_URL/smart/$REPO && + + # to trigger chunked pushing, we need a sufficiently large pack - use + # git v0.99 + GIT_REPO=$TEST_DIRECTORY/../.git && + test -d $GIT_REPO && + echo $GIT_REPO/objects > .git/objects/info/alternates && + git fetch $GIT_REPO refs/tags/v0.99 && + git branch $BRANCH FETCH_HEAD && + BRANCH_REF=$(git rev-parse --verify refs/heads/$BRANCH) && + git push -v -v origin $BRANCH 2>err && + grep "POST git-receive-pack (chunked)" err && + (cd "$HTTPD_DOCUMENT_ROOT_PATH"/$REPO && + test $BRANCH_REF = $(git rev-parse --verify refs/heads/$BRANCH)) +' + stop_httpd test_done -- 1.7.3.3.585.g74f6e -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html