Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork937
correctly handleuname-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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
gcmarx wants to merge10 commits intogitpython-developers:mainChoose a base branch fromgcmarx:main
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+27 −1
Open
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
ec00872
add tests for is_cygwin_git
gcmarxde5e57c
check for the existence/execute bit on the uname command before tryin…
gcmarx428be1a
adding self to authors
gcmarx58ff723
Revert "check for the existence/execute bit on the uname command befo…
gcmarx7187984
use pathlib.Path instead of os.path.isfile
gcmarx3f5a942
don't keep checking if sys.platform isn't 'cygwin'
gcmarx226f4ff
check that uname_cmd points to a file; if uname_cmd were a directory,…
gcmarx22d6284
don't use match-case, since it's a 3.10 feature
gcmarxb1289ee
it's is_file(), not isfile()
gcmarxcffa264
turns out f-strings before 3.8 don't support {variable=} notation, ta…
gcmarxFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletionsAUTHORS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletiongit/util.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -464,6 +464,12 @@ def _is_cygwin_git(git_executable: str) -> bool: | ||
# Just a name given, not a real path. | ||
uname_cmd = osp.join(git_dir, "uname") | ||
if not (pathlib.Path(uname_cmd).is_file() and os.access(uname_cmd, os.X_OK)): | ||
Byron marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
_logger.debug(f"Failed checking if running in CYGWIN: {uname_cmd} is not an executable") | ||
_is_cygwin_cache[git_executable] = is_cygwin | ||
return is_cygwin | ||
process = subprocess.Popen([uname_cmd], stdout=subprocess.PIPE, universal_newlines=True) | ||
uname_out, _ = process.communicate() | ||
# retcode = process.poll() | ||
@@ -484,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}") | ||
if sys.platform != "cygwin": | ||
return False | ||
elif git_executable is None: | ||
return False | ||
18 changes: 18 additions & 0 deletionstest/test_util.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.