git-remote-testgit: fix error handling

If fast-export did not complete successfully the error handling code
itself would error out.

This was broken in commit 23b093ee0 (Brandon Casey, Wed Jun 9 2010,
Remove python 2.5'isms). Revert that commit an introduce our own copy
of check_call in util.py instead.

Tested by changing 'if retcode' to 'if not retcode' temporarily.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sverre Rabbelier
2011-07-16 15:03:31 +02:00
committed by Junio C Hamano
parent 0fb56ce716
commit 460d10262d
5 changed files with 62 additions and 22 deletions

View File

@ -2,6 +2,8 @@ import os
import subprocess
import sys
from git_remote_helpers.util import check_call
class GitExporter(object):
"""An exporter for testgit repositories.
@ -53,6 +55,4 @@ class GitExporter(object):
args = ["sed", "s_refs/heads/_" + self.repo.prefix + "_g"]
child = subprocess.Popen(args, stdin=p1.stdout)
if child.wait() != 0:
raise CalledProcessError
check_call(args, stdin=p1.stdout)