@@ -464,6 +464,12 @@ def _is_cygwin_git(git_executable: str) -> bool:
464
464
465
465
# Just a name given, not a real path.
466
466
uname_cmd = osp .join (git_dir , "uname" )
467
+
468
+ if not (pathlib .Path (uname_cmd ).is_file () and os .access (uname_cmd , os .X_OK )):
469
+ _logger .debug (f"Failed checking if running in CYGWIN: { uname_cmd } is not an executable" )
470
+ _is_cygwin_cache [git_executable ] = is_cygwin
471
+ return is_cygwin
472
+
467
473
process = subprocess .Popen ([uname_cmd ], stdout = subprocess .PIPE , universal_newlines = True )
468
474
uname_out , _ = process .communicate ()
469
475
# retcode = process.poll()
@@ -484,7 +490,9 @@ def is_cygwin_git(git_executable: PathLike) -> bool: ...
484
490
485
491
486
492
def is_cygwin_git (git_executable : Union [None , PathLike ]) -> bool :
487
- if sys .platform == "win32" : # TODO: See if we can use `sys.platform != "cygwin"`.
493
+ # TODO: when py3.7 support is dropped, use the new interpolation f"{variable=}"
494
+ _logger .debug (f"sys.platform={ sys .platform !r} , git_executable={ git_executable !r} " )
495
+ if sys .platform != "cygwin" :
488
496
return False
489
497
elif git_executable is None :
490
498
return False
0 commit comments