@@ -310,7 +310,7 @@ def _cygexpath(drive: Optional[str], path: str) -> str:
310310 else :
311311 p = cygpath (p )
312312 elif drive :
313- p = "/cygdrive/%s/%s" % (drive .lower (), p )
313+ p = "/proc/ cygdrive/%s/%s" % (drive .lower (), p )
314314 p_str = str (p ) # ensure it is a str and not AnyPath
315315 return p_str .replace ("\\ " , "/" )
316316
@@ -334,7 +334,7 @@ def cygpath(path: str) -> str:
334334 """Use :meth:`git.cmd.Git.polish_url()` instead, that works on any environment."""
335335 path = str (path ) # ensure is str and not AnyPath.
336336 # Fix to use Paths when 3.5 dropped. or to be just str if only for urls?
337- if not path .startswith (("/cygdrive" , "//" )):
337+ if not path .startswith (("/cygdrive" , "//" , "/proc/cygdrive" )):
338338 for regex , parser , recurse in _cygpath_parsers :
339339 match = regex .match (path )
340340 if match :
@@ -348,7 +348,7 @@ def cygpath(path: str) -> str:
348348 return path
349349
350350
351- _decygpath_regex = re .compile (r"/cygdrive/(\w)(/.*)?" )
351+ _decygpath_regex = re .compile (r"(?:/proc)? /cygdrive/(\w)(/.*)?" )
352352
353353
354354def decygpath (path : PathLike ) -> str :
@@ -377,7 +377,9 @@ def is_cygwin_git(git_executable: PathLike) -> bool:
377377
378378
379379def is_cygwin_git (git_executable : Union [None , PathLike ]) -> bool :
380- if not is_win :
380+ if is_win :
381+ # is_win seems to be true only for Windows-native pythons
382+ # cygwin has os.name = posix, I think
381383 return False
382384
383385 if git_executable is None :
0 commit comments