diff options
author | Anil Khatri <anil.soccer.khatri@gmail.com> | 2019-10-23 23:51:15 +0530 |
---|---|---|
committer | Anil Khatri <anil.soccer.khatri@gmail.com> | 2019-10-23 23:51:15 +0530 |
commit | d4756f4a1298e053aaeae58b725863e8742d353a (patch) | |
tree | de992d78c7d5520d0112391c269b13a53ca6065c /git/cmd.py | |
parent | 1dc46d735003df8ff928974cb07545f69f8ea411 (diff) | |
parent | abb18968516c6c3c9e1d736bfe6f435392b3d3af (diff) | |
download | gitpython-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.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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: |