aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-09-14 22:05:57 -0700
committerJunio C Hamano <gitster@pobox.com>2009-09-14 22:18:36 -0700
commitd68fe26f3e03b230ac9bbbcf002a9acdc4bebde9 (patch)
tree7827947bd8327faee689ecf1f6497cad9f08121d /t
parentaeb84b05ae448596c336807631d9633492b3049a (diff)
downloadgit-d68fe26f3e03b230ac9bbbcf002a9acdc4bebde9.tar.gz
git-d68fe26f3e03b230ac9bbbcf002a9acdc4bebde9.tar.xz
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t4019-diff-wserror.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh
index 1e75f1a11..3a3663fbc 100755
--- a/t/t4019-diff-wserror.sh
+++ b/t/t4019-diff-wserror.sh
@@ -193,7 +193,7 @@ test_expect_success 'do not color trailing cr in context' '
test_expect_success 'color new trailing blank lines' '
{ echo a; echo b; echo; echo; } >x &&
git add x &&
- { echo a; echo; echo; echo; echo; } >x &&
+ { echo a; echo; echo; echo; echo c; echo; echo; echo; echo; } >x &&
git diff --color x >output &&
cnt=$(grep "${blue_grep}" output | wc -l) &&
test $cnt = 2