Merge branch 'fg/submodule-non-ascii-path'
[gitweb.git] / t / t5801-remote-helpers.sh
index 61479c3b16841c13798486590c56f265d821176c..8c4c5396a8447fc39d6f0c697af761631b08b3f7 100755 (executable)
@@ -175,13 +175,27 @@ 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 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 +210,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
        )
 '