Merge branch 'jk/http-backend-deadlock-2.2' into jk/http-backend-deadlock-2.3
[gitweb.git] / t / t5551-http-fetch-smart.sh
index 2d8e5a0fbefa4f02c47d529bb8930e0f9e0a3ada..1cca6832904fc237a25c8873675765bfdd2d1506 100755 (executable)
@@ -238,22 +238,35 @@ create_tags () {
        sed -e "s|^:\([^ ]*\) \(.*\)$|\2 refs/tags/$tag-\1|" <marks >>packed-refs
 }
 
-test_expect_success 'create 50,000 tags in the repo' '
+test_expect_success 'create 2,000 tags in the repo' '
        (
                cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-               create_tags 1 50000
+               create_tags 1 2000
        )
 '
 
-test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' '
-       git clone $HTTPD_URL/smart/repo.git too-many-refs &&
+test_expect_success CMDLINE_LIMIT \
+       'clone the 2,000 tag repo to check OS command line overflow' '
+       run_with_limited_cmdline git clone $HTTPD_URL/smart/repo.git too-many-refs &&
        (
                cd too-many-refs &&
-               test $(git for-each-ref refs/tags | wc -l) = 50000
+               git for-each-ref refs/tags >actual &&
+               test_line_count = 2000 actual
        )
 '
 
+test_expect_success 'large fetch-pack requests can be split across POSTs' '
+       GIT_CURL_VERBOSE=1 git -c http.postbuffer=65536 \
+               clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
+       grep "^> POST" err >posts &&
+       test_line_count = 2 posts
+'
+
 test_expect_success EXPENSIVE 'http can handle enormous ref negotiation' '
+       (
+               cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+               create_tags 2001 50000
+       ) &&
        git -C too-many-refs fetch -q --tags &&
        (
                cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&