diff --git a/git/cmd.py b/git/cmd.py index 50b1e3212..d41f8f89a 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -330,6 +330,9 @@ def polish_url(cls, url, is_cygwin=None): 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