Skip to content
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

Fix handling of EOF in createPatch #535

Merged
merged 6 commits into from
Jul 29, 2024
Merged

Fix handling of EOF in createPatch #535

merged 6 commits into from
Jul 29, 2024

Conversation

ExplodingCabbage
Copy link
Collaborator

@ExplodingCabbage ExplodingCabbage commented Jul 29, 2024

Fixes #531.

But also rips out the ability to pass newlineIsToken to createPatch et al, because my changes here broke the tests (that @oBusk had added in #345) for that feature and when I dug into it I realised - like I think @oBusk kinda implies in that PR description - that the whole feature is kinda broken, since it causes line ending changes to get falsely represented as deletions and insertions of entire blank lines in the patch.

(I suspect @Kiougar didn't consider the newlineIsToken option specifically back in 2016 when he wrote #153, and was probably thinking primarily about options like ignoreWhitespace which do make sense to pass to patch functions.)

@ExplodingCabbage ExplodingCabbage marked this pull request as ready for review July 29, 2024 13:58
@ExplodingCabbage ExplodingCabbage merged commit 939bb45 into master Jul 29, 2024
@ExplodingCabbage ExplodingCabbage deleted the fix-eof-logic branch July 29, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug w/ createPatch() when modifying file ending without new line
1 participant