Skip to content

Fix changed_lines number calculation - #336

Merged
sanemat merged 1 commit into
packsaddle:masterfrom
radomirbosak:fix-no-newline-at-eof
Nov 4, 2021
Merged

Fix changed_lines number calculation#336
sanemat merged 1 commit into
packsaddle:masterfrom
radomirbosak:fix-no-newline-at-eof

Conversation

@radomirbosak

@radomirbosak radomirbosak commented Nov 4, 2021

Copy link
Copy Markdown

\ No newline at end of file is inserted when the file does not contain LF at EOF. Ignore the message to count line numbers correctly.

This is a commit I found in @soutaro's branch fix-no-newline-at-eof, but I think it would be useful to have this patch merged in upstream too.

Tested with bin/console on a small sample diff file.

Fixes #335

`\ No newline at end of file` is inserted when the file does not contain LF at EOF. Ignore the message to count line numbers correctly.

@sanemat sanemat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice.
LGTM

@sanemat
sanemat merged commit 999420e into packsaddle:master Nov 4, 2021
@sanemat

sanemat commented Nov 4, 2021

Copy link
Copy Markdown
Member

@radomirbosak

Copy link
Copy Markdown
Author

Thank you for the quick reply and release @sanemat 😄 You are the best!

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.

Patch.changed_lines method's numbering falsely includes lines like \ No newline at end of file

3 participants