Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed#731
Added check for local file url starting with `$HOME` / `~` to expand them using `os.path.expanduser`.
  • Loading branch information
toanant authored Oct 10, 2019
commit 26fbad62229a5f4b3e422c67d96e4d152dfaee2d
4 changes: 4 additions & 0 deletions git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ 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.
"""
if url.startswith('$HOME/'):
url = url.replace('$HOME/', '~/')
if url.startswith('~'):
url = os.path.expanduser(url)
url = url.replace("\\\\", "\\").replace("\\", "/")

return url
Expand Down