summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Felipe Contreras <felipe.contreras@gmail.com>2012-10-22 22:56:34 +0200
committerLibravatar Jeff King <peff@peff.net>2012-10-29 04:01:00 -0400
commit6c323322682abed3bb2a3904596b529ebccddb1c (patch)
tree647314ef2004ab05d56dddbb7c5e718c6e5559c5 /t
parentMerge branch 'jk/strbuf-detach-always-non-null' (diff)
downloadtgif-6c323322682abed3bb2a3904596b529ebccddb1c.tar.xz
remote-testgit: properly check for errors
'feature done' was missing, which allowed fast-import exit properly, and transport-helper to continue checking for refs and what not when in fact the remote-helper died. Let's enable that, and make sure the error paths are triggered. Now transport-helper correctly detects the errors from fast-import, unfortunately, not from fast-export because it might finish before detecting a SIGPIPE. This means transport-helper will quit silently and the user will not see any errors, which is bad. Hopefully the helper will print the error before dying anyway, so not all is lost. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t5800-remote-helpers.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh
index e7dc668cef..446cc8e017 100755
--- a/t/t5800-remote-helpers.sh
+++ b/t/t5800-remote-helpers.sh
@@ -145,4 +145,25 @@ test_expect_failure 'push new branch with old:new refspec' '
compare_refs clone HEAD server refs/heads/new-refspec
'
+test_expect_success 'proper failure checks for fetching' '
+ (GIT_REMOTE_TESTGIT_FAILURE=1 &&
+ export GIT_REMOTE_TESTGIT_FAILURE &&
+ cd localclone &&
+ test_must_fail git fetch 2>&1 | \
+ grep "Error while running fast-import"
+ )
+'
+
+# We sleep to give fast-export a chance to catch the SIGPIPE
+test_expect_failure 'proper failure checks for pushing' '
+ (GIT_REMOTE_TESTGIT_FAILURE=1 &&
+ export GIT_REMOTE_TESTGIT_FAILURE &&
+ GIT_REMOTE_TESTGIT_SLEEPY=1 &&
+ export GIT_REMOTE_TESTGIT_SLEEPY &&
+ cd localclone &&
+ test_must_fail git push --all 2>&1 | \
+ grep "Error while running fast-export"
+ )
+'
+
test_done