use 'sys.platform == "cygwin"' to figure out when we are using cygwin #2027
+1
−86
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.
The current logic for detecting cygwin is:
sys.platform == "win32"
, then it's not cygwinuname
executable in the same folder as the git executable, and if so, does the output of that command include"CYGWIN"
? if so, then it's cygwinIn the python 3.7 docs for sys.platform, Cygwin systems have
sys.platform == "cygwin"
. Since Python 3.7 is the oldest version still supported by GitPython, it stands to reason that we can rely on that being true for all supported Python versions.The logic I propose is:
sys.platform == 'cygwin'
, then it's cygwin gitThis is simple enough for a single expression, so I replaced the body of the
is_cygwin
function with that expression and removedis_cygwin_git
and friends completely.I don't know if there's such a thing as
sys.platform == 'cygwin'
and thegit
not being cygwingit
, but if there is, I don't think the existing code deals with that anyway, so this seems to return the same result and would fail in the same way.