Please sign in to comment.
Fix '\ No newline...' annotation in rewrite diffs
When a file that ends with an incomplete line is expressed as a complete rewrite with the -B option, git diff incorrectly appends the incomplete line indicator "\ No newline at end of file" after such a line, rather than writing it on a line of its own (the output codepath for normal output without -B does not have this problem). Add a LF after the incomplete line before writing the "\ No newline ..." out to fix this. Add a couple of tests to confirm that the indicator comment is generated on its own line in both plain diff and rewrite mode. Signed-off-by: Adam Butcher <firstname.lastname@example.org> Signed-off-by: Junio C Hamano <email@example.com>
- Loading branch information...
Showing with 31 additions and 0 deletions.