Merge branch 'np/lookup-object-hashing'
[gitweb.git] / t / t5801-remote-helpers.sh
index 61479c3b16841c13798486590c56f265d821176c..613f69a254bab23e1f09126b4a7f3dca8692deaa 100755 (executable)
@@ -175,13 +175,38 @@ test_expect_success 'push update refs' '
        git checkout -b update master &&
        echo update >>file &&
        git commit -a -m update &&
-       git push origin update
+       git push origin update &&
        git rev-parse --verify remotes/origin/update >expect &&
        git rev-parse --verify testgit/origin/heads/update >actual &&
        test_cmp expect actual
        )
 '
 
+test_expect_success 'push update refs disabled by no-private-update' '
+       (cd local &&
+       echo more-update >>file &&
+       git commit -a -m more-update &&
+       git rev-parse --verify testgit/origin/heads/update >expect &&
+       GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE=t git push origin update &&
+       git rev-parse --verify testgit/origin/heads/update >actual &&
+       test_cmp expect actual
+       )
+'
+
+test_expect_success 'push update refs failure' '
+       (cd local &&
+       git checkout update &&
+       echo "update fail" >>file &&
+       git commit -a -m "update fail" &&
+       git rev-parse --verify testgit/origin/heads/update >expect &&
+       GIT_REMOTE_TESTGIT_PUSH_ERROR="non-fast forward" &&
+       export GIT_REMOTE_TESTGIT_PUSH_ERROR &&
+       test_expect_code 1 git push origin update &&
+       git rev-parse --verify testgit/origin/heads/update >actual &&
+       test_cmp expect actual
+       )
+'
+
 test_expect_success 'proper failure checks for fetching' '
        (GIT_REMOTE_TESTGIT_FAILURE=1 &&
        export GIT_REMOTE_TESTGIT_FAILURE &&
@@ -196,9 +221,7 @@ test_expect_success 'proper failure checks for pushing' '
        (GIT_REMOTE_TESTGIT_FAILURE=1 &&
        export GIT_REMOTE_TESTGIT_FAILURE &&
        cd local &&
-       test_must_fail git push --all 2> error &&
-       cat error &&
-       grep -q "Reading from helper .git-remote-testgit. failed" error
+       test_must_fail git push --all
        )
 '