aboutsummaryrefslogtreecommitdiffstats
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-15 23:06:34 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-15 23:06:34 -0800
commit6dbdba00ea2175894e1ad7a5e96899b7b087ed1d (patch)
treec5e9d23a0342c88617e117fa85cad2dcc76bd8f4 /t/t4015-diff-whitespace.sh
parentMerge branch 'jc/maint-1.6.3-graft-trailing-space' into maint (diff)
parentMerge branch 'jc/maint-1.6.0-blank-at-eof' into jc/maint-blank-at-eof (diff)
downloadgit-6dbdba00ea2175894e1ad7a5e96899b7b087ed1d.tar.gz
git-6dbdba00ea2175894e1ad7a5e96899b7b087ed1d.zip
Merge branch 'jc/maint-blank-at-eof' into maint
* jc/maint-blank-at-eof: diff -B: colour whitespace errors diff.c: emit_add_line() takes only the rest of the line diff.c: split emit_line() from the first char and the rest of the line diff.c: shuffling code around diff --whitespace: fix blank lines at end core.whitespace: split trailing-space into blank-at-{eol,eof} diff --color: color blank-at-eof diff --whitespace=warn/error: fix blank-at-eof check diff --whitespace=warn/error: obey blank-at-eof diff.c: the builtin_diff() deals with only two-file comparison apply --whitespace: warn blank but not necessarily empty lines at EOF apply --whitespace=warn/error: diagnose blank at EOF apply.c: split check_whitespace() into two apply --whitespace=fix: detect new blank lines at eof correctly apply --whitespace=fix: fix handling of blank lines at the eof
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 6d13da30da..8dd147d78f 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' '