summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 3fc616f5..c43fac56 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -196,16 +196,19 @@ class Git(LazyMixin):
return is_cygwin_git(cls.GIT_PYTHON_GIT_EXECUTABLE)
@classmethod
- def polish_url(cls, url):
- if cls.is_cygwin():
+ def polish_url(cls, url, is_cygwin=None):
+ if is_cygwin is None:
+ is_cygwin = cls.is_cygwin()
+
+ if is_cygwin:
+ url = cygpath(url)
+ else:
"""Remove any backslahes from urls to be written in config files.
Windows might create config-files containing paths with backslashed,
but git stops liking them as it will escape the backslashes.
Hence we undo the escaping just to be sure.
"""
- url = cygpath(url)
- else:
url = url.replace("\\\\", "\\").replace("\\", "/")
return url