summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Kumar Singh <toanant@users.noreply.github.com>2019-10-16 21:57:51 +0530
committerSebastian Thiel <sebastian.thiel@icloud.com>2019-10-17 09:02:12 +0200
commit43564d2e8f3b95f33e10a5c8cc2d75c0252d659a (patch)
treec10d0c93b0c8dffe2c47ecc8585248b430459cdc
parent2ba39bd0f0b27152de78394d2a37f3f81016d848 (diff)
downloadgitpython-43564d2e8f3b95f33e10a5c8cc2d75c0252d659a.tar.gz
Update cmd.py
-rw-r--r--git/cmd.py3
1 files changed, 1 insertions, 2 deletions
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("\\", "/")