diff options
author | Cory Johns <cjohns@slashdotmedia.com> | 2013-10-09 19:02:56 +0000 |
---|---|---|
committer | Cory Johns <cjohns@slashdotmedia.com> | 2013-10-09 20:49:44 +0000 |
commit | d3a728277877924e889e9fef42501127f48a4e77 (patch) | |
tree | 930599537d72c28517b045924433f44ef7eb8da6 /git/util.py | |
parent | 5869c5c1a51d448a411ae0d51d888793c35db9c0 (diff) | |
download | gitpython-d3a728277877924e889e9fef42501127f48a4e77.tar.gz |
[#5330] Ensure wait() is called on git processes
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 12 |
1 files changed, 12 insertions, 0 deletions
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 |