X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4015-diff-whitespace.sh;h=8dd147d78f6ee6a4be4b1af235ed35af19b273df;hb=aa06b4d3f43be3879556361768a07934f23ac230;hp=6d13da30dad5a78fb17a01e86ef33072ea9e6250;hpb=dcbf0417453297207c7e61efbf1f38621b1caa3f;p=git.git diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh index 6d13da30d..8dd147d78 100755 --- a/t/t4015-diff-whitespace.sh +++ b/t/t4015-diff-whitespace.sh @@ -362,10 +362,17 @@ test_expect_success 'line numbers in --check output are correct' ' ' -test_expect_success 'checkdiff detects trailing blank lines' ' +test_expect_success 'checkdiff detects new trailing blank lines (1)' ' echo "foo();" >x && echo "" >>x && - git diff --check | grep "ends with blank" + git diff --check | grep "new blank line" +' + +test_expect_success 'checkdiff detects new trailing blank lines (2)' ' + { echo a; echo b; echo; echo; } >x && + git add x && + { echo a; echo; echo; echo; echo; } >x && + git diff --check | grep "new blank line" ' test_expect_success 'checkdiff allows new blank lines' '