author | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Sep 2009 05:05:57 +0000 (22:05 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Sep 2009 05:18:36 +0000 (22:18 -0700) | ||
commit | d68fe26f3e03b230ac9bbbcf002a9acdc4bebde9 | |
tree | 7827947bd8327faee689ecf1f6497cad9f08121d | tree | snapshot |
parent | aeb84b05ae448596c336807631d9633492b3049a | commit | diff |
diff --whitespace: fix blank lines at end
The earlier logic tried to colour any and all blank lines that were added
beyond the last blank line in the original, but this was very wrong. If
you added 96 blank lines, a non-blank line, and then 3 blank lines at the
end, only the last 3 lines should trigger the error, not the earlier 96
blank lines.
We need to also make sure that the lines are after the last non-blank line
in the postimage as well before deciding to paint them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The earlier logic tried to colour any and all blank lines that were added
beyond the last blank line in the original, but this was very wrong. If
you added 96 blank lines, a non-blank line, and then 3 blank lines at the
end, only the last 3 lines should trigger the error, not the earlier 96
blank lines.
We need to also make sure that the lines are after the last non-blank line
in the postimage as well before deciding to paint them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | diff | blob | history | |
t/t4019-diff-wserror.sh | diff | blob | history |