From d3a728277877924e889e9fef42501127f48a4e77 Mon Sep 17 00:00:00 2001 From: Cory Johns Date: Wed, 9 Oct 2013 19:02:56 +0000 Subject: [#5330] Ensure wait() is called on git processes --- git/util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'git/util.py') diff --git a/git/util.py b/git/util.py index a9e87d6f..130d7762 100644 --- a/git/util.py +++ b/git/util.py @@ -121,6 +121,18 @@ def get_user_id(): # END get username from login return "%s@%s" % (username, platform.node()) +def finalize_process(proc): + """Wait for the process (clone, fetch, pull or push) and handle its errors accordingly""" + try: + proc.wait() + except GitCommandError,e: + # if a push has rejected items, the command has non-zero return status + # a return status of 128 indicates a connection error - reraise the previous one + if proc.poll() == 128: + raise + pass + # END exception handling + #} END utilities #{ Classes -- cgit v1.2.1 From 2e6957abf8cd88824282a19b74497872fe676a46 Mon Sep 17 00:00:00 2001 From: Dave Brondsema Date: Tue, 28 Jan 2014 21:07:31 -0500 Subject: Fix missed import from d3a7282 The `finalize_process` method was moved but this import wasn't carried with it. --- git/util.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git/util.py') diff --git a/git/util.py b/git/util.py index 130d7762..0a533e50 100644 --- a/git/util.py +++ b/git/util.py @@ -13,6 +13,8 @@ import shutil import tempfile import platform +from exc import GitCommandError + from gitdb.util import ( make_sha, LockedFD, -- cgit v1.2.1