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>
This commit is contained in:
Felipe Contreras
2012-10-22 22:56:34 +02:00
committed by Jeff King
parent 2cfceefaca
commit 6c32332268
2 changed files with 29 additions and 0 deletions

View File

@@ -159,6 +159,11 @@ def do_import(repo, args):
ref = line[7:].strip()
refs.append(ref)
print "feature done"
if os.environ.get("GIT_REMOTE_TESTGIT_FAILURE"):
die('Told to fail')
repo = update_local_repo(repo)
repo.exporter.export_repo(repo.gitdir, refs)
@@ -172,6 +177,9 @@ def do_export(repo, args):
if not repo.gitdir:
die("Need gitdir to export")
if os.environ.get("GIT_REMOTE_TESTGIT_FAILURE"):
die('Told to fail')
update_local_repo(repo)
changed = repo.importer.do_import(repo.gitdir)