diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-06-21 11:45:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 11:45:00 +0800 |
commit | f0c6e1164f390081a27de952552aa83d34035f2a (patch) | |
tree | fcd116711c75c126c2fd083bb6a8c78ced5870ef /git/util.py | |
parent | 6660b8463b86ea92ff56baebfcebc7c8a6e933fa (diff) | |
parent | 2996f402f11565c3ad93aedfe070f4f5f571e72e (diff) | |
download | gitpython-f0c6e1164f390081a27de952552aa83d34035f2a.tar.gz |
Merge pull request #1455 from DWesl/patch-1
Re-enable Cygwin CI and get most tests passing
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/git/util.py b/git/util.py index 11139156..6a4a6557 100644 --- a/git/util.py +++ b/git/util.py @@ -310,7 +310,7 @@ def _cygexpath(drive: Optional[str], path: str) -> str: else: p = cygpath(p) elif drive: - p = "/cygdrive/%s/%s" % (drive.lower(), p) + p = "/proc/cygdrive/%s/%s" % (drive.lower(), p) p_str = str(p) # ensure it is a str and not AnyPath return p_str.replace("\\", "/") @@ -334,7 +334,7 @@ def cygpath(path: str) -> str: """Use :meth:`git.cmd.Git.polish_url()` instead, that works on any environment.""" path = str(path) # ensure is str and not AnyPath. # Fix to use Paths when 3.5 dropped. or to be just str if only for urls? - if not path.startswith(("/cygdrive", "//")): + if not path.startswith(("/cygdrive", "//", "/proc/cygdrive")): for regex, parser, recurse in _cygpath_parsers: match = regex.match(path) if match: @@ -348,7 +348,7 @@ def cygpath(path: str) -> str: return path -_decygpath_regex = re.compile(r"/cygdrive/(\w)(/.*)?") +_decygpath_regex = re.compile(r"(?:/proc)?/cygdrive/(\w)(/.*)?") def decygpath(path: PathLike) -> str: @@ -377,7 +377,9 @@ def is_cygwin_git(git_executable: PathLike) -> bool: def is_cygwin_git(git_executable: Union[None, PathLike]) -> bool: - if not is_win: + if is_win: + # is_win seems to be true only for Windows-native pythons + # cygwin has os.name = posix, I think return False if git_executable is None: |