http: clear POSTFIELDS when initializing a slot
[gitweb.git] / t / t5540-http-push.sh
index ad0f14b93c50450343ccc6f938456ae8426a73a8..2ece6612e13a8ae563cd992f083e1b0be4de34f5 100755 (executable)
@@ -36,6 +36,7 @@ test_expect_success 'setup remote repository' '
        cd test_repo.git &&
        git --bare update-server-info &&
        mv hooks/post-update.sample hooks/post-update &&
+       ORIG_HEAD=$(git rev-parse --verify HEAD) &&
        cd - &&
        mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
 '
@@ -45,7 +46,7 @@ test_expect_success 'clone remote repository' '
        git clone $HTTPD_URL/test_repo.git test_repo_clone
 '
 
-test_expect_failure 'push to remote repository with packed refs' '
+test_expect_success 'push to remote repository with packed refs' '
        cd "$ROOT_PATH"/test_repo_clone &&
        : >path2 &&
        git add path2 &&
@@ -57,17 +58,21 @@ test_expect_failure 'push to remote repository with packed refs' '
         test $HEAD = $(git rev-parse --verify HEAD))
 '
 
-test_expect_success ' push to remote repository with unpacked refs' '
+test_expect_success 'push already up-to-date' '
+       git push
+'
+
+test_expect_success 'push to remote repository with unpacked refs' '
        (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
         rm packed-refs &&
-        git update-ref refs/heads/master \
-               0c973ae9bd51902a28466f3850b543fa66a6aaf4) &&
+        git update-ref refs/heads/master $ORIG_HEAD &&
+        git --bare update-server-info) &&
        git push &&
        (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
         test $HEAD = $(git rev-parse --verify HEAD))
 '
 
-test_expect_failure 'http-push fetches unpacked objects' '
+test_expect_success 'http-push fetches unpacked objects' '
        cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
                "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo_unpacked.git &&
 
@@ -83,7 +88,7 @@ test_expect_failure 'http-push fetches unpacked objects' '
         git push -f -v $HTTPD_URL/test_repo_unpacked.git master)
 '
 
-test_expect_failure 'http-push fetches packed objects' '
+test_expect_success 'http-push fetches packed objects' '
        cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
                "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo_packed.git &&
 
@@ -113,7 +118,6 @@ test_expect_success 'create and delete remote branch' '
        git push origin dev &&
        git fetch &&
        git push origin :dev &&
-       git branch -d -r origin/dev &&
        git fetch &&
        test_must_fail git show-ref --verify refs/remotes/origin/dev
 '