summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorAnil Khatri <anil.soccer.khatri@gmail.com>2019-10-23 23:51:15 +0530
committerAnil Khatri <anil.soccer.khatri@gmail.com>2019-10-23 23:51:15 +0530
commitd4756f4a1298e053aaeae58b725863e8742d353a (patch)
treede992d78c7d5520d0112391c269b13a53ca6065c /git/cmd.py
parent1dc46d735003df8ff928974cb07545f69f8ea411 (diff)
parentabb18968516c6c3c9e1d736bfe6f435392b3d3af (diff)
downloadgitpython-d4756f4a1298e053aaeae58b725863e8742d353a.tar.gz
Merge branch 'fix/deepsource-issues' of github.com:imkaka/GitPython 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: