From 2ba39bd0f0b27152de78394d2a37f3f81016d848 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Singh Date: Thu, 10 Oct 2019 18:06:26 +0530 Subject: Fixed#731 Added check for local file url starting with `$HOME` / `~` to expand them using `os.path.expanduser`. --- git/cmd.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 2d288b25..a06daaaf 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -330,6 +330,10 @@ class Git(LazyMixin): but git stops liking them as it will escape the backslashes. Hence we undo the escaping just to be sure. """ + if url.startswith('$HOME/'): + url = url.replace('$HOME/', '~/') + if url.startswith('~'): + url = os.path.expanduser(url) url = url.replace("\\\\", "\\").replace("\\", "/") return url -- cgit v1.2.3 From 43564d2e8f3b95f33e10a5c8cc2d75c0252d659a Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Singh Date: Wed, 16 Oct 2019 21:57:51 +0530 Subject: Update cmd.py --- git/cmd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index a06daaaf..78319c75 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -330,8 +330,7 @@ class Git(LazyMixin): but git stops liking them as it will escape the backslashes. Hence we undo the escaping just to be sure. """ - if url.startswith('$HOME/'): - url = url.replace('$HOME/', '~/') + url = os.path.expandvars(url) if url.startswith('~'): url = os.path.expanduser(url) url = url.replace("\\\\", "\\").replace("\\", "/") -- cgit v1.2.3 From b303cb0c5995bf9c74db34a8082cdf5258c250fe Mon Sep 17 00:00:00 2001 From: JJ Graham Date: Sun, 20 Oct 2019 15:40:06 -0500 Subject: Initial stab at fixing diffs involving submodule changes --- git/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 78319c75..263c8ba7 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 -- cgit v1.2.3 From dfa0eac1578bff14a8f7fa00bfc3c57aba24f877 Mon Sep 17 00:00:00 2001 From: Ben Thayer Date: Tue, 22 Oct 2019 14:39:50 -0500 Subject: Added exception handling for WinError6 --- git/cmd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 263c8ba7..484a0181 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -365,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: -- cgit v1.2.3