summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorAnil Khatri <27620628+imkaka@users.noreply.github.com>2019-10-23 23:37:43 +0530
committerGitHub <noreply@github.com>2019-10-23 23:37:43 +0530
commitabb18968516c6c3c9e1d736bfe6f435392b3d3af (patch)
tree46b45bc52901f0f52526f9573f06b2fc0f777231 /git/cmd.py
parent284f89d768080cb86e0d986bfa1dd503cfe6b682 (diff)
parentdfa0eac1578bff14a8f7fa00bfc3c57aba24f877 (diff)
downloadgitpython-abb18968516c6c3c9e1d736bfe6f435392b3d3af.tar.gz
Merge branch 'master' into fix/deepsource-issues
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 661e9bb7..a13556aa 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -67,7 +67,7 @@ __all__ = ('Git',)
def handle_process_output(process, stdout_handler, stderr_handler,
finalizer=None, decode_streams=True):
- """Registers for notifications to lean that process output is ready to read, and dispatches lines to
+ """Registers for notifications to learn that process output is ready to read, and dispatches lines to
the respective line handlers.
This function returns once the finalizer returns
@@ -330,6 +330,9 @@ class Git(LazyMixin):
but git stops liking them as it will escape the backslashes.
Hence we undo the escaping just to be sure.
"""
+ url = os.path.expandvars(url)
+ if url.startswith('~'):
+ url = os.path.expanduser(url)
url = url.replace("\\\\", "\\").replace("\\", "/")
return url
@@ -362,8 +365,11 @@ class Git(LazyMixin):
proc.stderr.close()
# did the process finish already so we have a return code ?
- if proc.poll() is not None:
- return
+ try:
+ if proc.poll() is not None:
+ return
+ except OSError as ex:
+ log.info("Ignored error after process had died: %r", ex)
# can be that nothing really exists anymore ...
if os is None or getattr(os, 'kill', None) is None: