Skip to content

correctly handle uname-cmd that doesn't point to an executable file #2026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
incorporate review feedback from @EliahKagan
  • Loading branch information
gcmarx committed May 28, 2025
commit f3ab5d3810b1e8c1f0365d26eea3e91808d8e4af
3 changes: 2 additions & 1 deletion git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ def is_cygwin_git(git_executable: PathLike) -> bool: ...


def is_cygwin_git(git_executable: Union[None, PathLike]) -> bool:
_logger.debug(f"sys.platform = {sys.platform}, git_executable = {git_executable}")
# TODO: when py3.7 support is dropped, use the new interpolation f"{variable=}"
_logger.debug(f"sys.platform={sys.platform!r}, git_executable={git_executable!r}")
if sys.platform != "cygwin":
return False
elif git_executable is None:
Expand Down
1 change: 1 addition & 0 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ class TestIsCygwinGit:
"""Tests for :func:`is_cygwin_git`"""

def test_on_path_executable(self):
# Currently we assume tests run on Cygwin use Cygwin git. See #533 and #1455 for background.
if sys.platform == "cygwin":
assert is_cygwin_git("git")
else:
Expand Down
Loading