Merge branch 'dm/http-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Wed, 11 May 2011 18:37:38 +0000 (11:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 May 2011 18:37:38 +0000 (11:37 -0700)
* dm/http-cleanup:
t5541-http-push: add test for chunked
http-push: refactor curl_easy_setup madness
http-push: use const for strings in signatures
http: make curl callbacks match contracts from curl header

1  2 
t/t5541-http-push.sh
diff --combined t/t5541-http-push.sh
index d924056c8a16f6029f1f3227ef806f0def326bdd,4b93fa1264a13c7864706b3234e563c122362cc8..a73c82635ff6fba6fcef4f139ff09205c1b9b6de
@@@ -65,14 -65,16 +65,16 @@@ test_expect_success 'clone remote repos
        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 ([0-9]* bytes)" err &&
        (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
         test $HEAD = $(git rev-parse --verify HEAD))
  '
@@@ -135,10 -137,22 +137,22 @@@ test_expect_success 'push fails for non
        grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
  '
  
 -test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
 -      grep "To prevent you from losing history, non-fast-forward updates were rejected" \
 +test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
 +      test_i18ngrep "To prevent you from losing history, non-fast-forward updates were rejected" \
                output
  '
  
+ test_expect_success 'push (chunked)' '
+       git checkout master &&
+       test_commit commit path3 &&
+       HEAD=$(git rev-parse --verify HEAD) &&
+       git config http.postbuffer 4 &&
+       test_when_finished "git config --unset http.postbuffer" &&
+       git push -v -v origin $BRANCH 2>err &&
+       grep "POST git-receive-pack (chunked)" err &&
+       (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
+        test $HEAD = $(git rev-parse --verify HEAD))
+ '
  stop_httpd
  test_done