packsaddle / ruby-git_diff_parser

Parse `git diff` into patches and lines.
http://packsaddle.org
MIT License
33 stars 14 forks source link

Fix changed_lines number calculation #336

Closed radomirbosak closed 2 years ago

radomirbosak commented 2 years ago

\ 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

sanemat commented 2 years ago

@radomirbosak @soutaro shipped it! https://rubygems.org/gems/git_diff_parser/versions/4.0.0 thanks :heart_eyes:

radomirbosak commented 2 years ago

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