Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 226f4ff

Browse files
committed
check that uname_cmd points to a file; if uname_cmd were a directory, it could both exist and have os.X_OK but not work
1 parent 3f5a942 commit 226f4ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def _is_cygwin_git(git_executable: str) -> bool:
465465
# Just a name given, not a real path.
466466
uname_cmd = osp.join(git_dir, "uname")
467467

468-
if not (pathlib.Path(uname_cmd).exists() and os.access(uname_cmd, os.X_OK)):
468+
if not (pathlib.Path(uname_cmd).isfile() and os.access(uname_cmd, os.X_OK)):
469469
_logger.debug(f"Failed checking if running in CYGWIN: {uname_cmd} is not an executable")
470470
_is_cygwin_cache[git_executable] = is_cygwin
471471
return is_cygwin

0 commit comments

Comments
 (0)