summaryrefslogtreecommitdiff
path: root/git/test/lib/helper.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-04-08 10:41:18 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-04-08 10:41:18 +0200
commit723f100a422577235e06dc024a73285710770fca (patch)
treeb57fa57b0929770029ca7a71389bd8d5410410d2 /git/test/lib/helper.py
parent98f6995bdcbd10ea0387d0c55cb6351b81a857fd (diff)
downloadgitpython-723f100a422577235e06dc024a73285710770fca.tar.gz
fix(docs): be clear about exit code handling
When pushing/pulling, we ignore errors unless it's exit code 128. The reason for this is now made explicit to make clear that issues are handled by PushInfo flags accordingly. Related #271
Diffstat (limited to 'git/test/lib/helper.py')
-rw-r--r--git/test/lib/helper.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py
index 31bee78f..541b972d 100644
--- a/git/test/lib/helper.py
+++ b/git/test/lib/helper.py
@@ -232,7 +232,13 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
prev_cwd = os.getcwd()
os.chdir(rw_repo.working_dir)
try:
- return func(self, rw_repo, rw_remote_repo)
+ try:
+ return func(self, rw_repo, rw_remote_repo)
+ except:
+ print("Keeping repos after failure: repo_dir = %s, remote_repo_dir = %s"
+ % (repo_dir, remote_repo_dir), file=sys.stderr)
+ repo_dir = remote_repo_dir = None
+ raise
finally:
# gd.proc.kill() ... no idea why that doesn't work
if gd is not None:
@@ -241,8 +247,10 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
os.chdir(prev_cwd)
rw_repo.git.clear_cache()
rw_remote_repo.git.clear_cache()
- shutil.rmtree(repo_dir, onerror=_rmtree_onerror)
- shutil.rmtree(remote_repo_dir, onerror=_rmtree_onerror)
+ if repo_dir:
+ shutil.rmtree(repo_dir, onerror=_rmtree_onerror)
+ if remote_repo_dir:
+ shutil.rmtree(remote_repo_dir, onerror=_rmtree_onerror)
if gd is not None:
gd.proc.wait()