diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-14 11:24:51 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-14 17:43:18 +0200 |
commit | 0bce7cc4a43e5843c9f4939db143a9d92bb45a18 (patch) | |
tree | 2dec4c389cd69c17f63898e197f3e0113919fcae /git/cmd.py | |
parent | e6e23ed24b35c6154b4ee0da5ae51cd5688e5e67 (diff) | |
download | gitpython-0bce7cc4a43e5843c9f4939db143a9d92bb45a18.tar.gz |
cygwin, #533: FIX daemon launching
+ Rework git-daemon launching with `with` resource-management.
+ cmd: add `is_cygwin` optional override kwd on `Git.polish_url()`.
- Cygwin TCs failing:
- PY2: err: 13, fail: 3
- PY3: err: 12, fail: 3
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |