Repository navigation
Detect windows using os.name rather than line.separator. - #639
Merged
Merged
Conversation
…orm is unreliable. Deprecate `LineEnding.nativeIsWin()`, and add `FileSignature.machineIsWin()`.
…machineIsWin()`. Notably, none of the usages actually cared about line endings, they only cared about paths and default system shells, which indicates that bundling this with `LineEnding` was probably always a bad idea.
J-N-K
reviewed
Jul 4, 2020
J-N-K
left a comment
Contributor
There was a problem hiding this comment.
This should work in any case and the performance penalty on *nix machines is probably neglegible. Even if you keep the check (probably a !machineIsUnix() would be more clear, since that is essentially what is interesting here) you could keep the File.separatorChar.
Co-authored-by: J-N-K <[email protected]>
Co-authored-by: J-N-K <[email protected]>
Member
Author
|
Ooh, I like the |
…ure we don't duplicate it.
Member
Author
|
There was a related bug, which was completely clobbering the git-native line endings anyway. Just fixed in previous commit. With these fixes combined, I think we have fixed the problem completely. |
Member
Author
|
Released in |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added
FileSignature.machineIsWin, which detects the OS usingos.name, and replaces the now-deprecatedLineEnding.nativeIsWin, which detected the OS usingline.separator.