summaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-06-26 22:36:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-06-27 05:07:26 (GMT)
commit877f23ccb88227203f2576abdfb5d1c15925fcb3 (patch)
tree6d54619f825b9e489f90928f9f7af670cc0a4cb8 /t/t4015-diff-whitespace.sh
parent1ba111d1d6bd90b2c120ceb05418e01ee304cc46 (diff)
downloadgit-877f23ccb88227203f2576abdfb5d1c15925fcb3.zip
git-877f23ccb88227203f2576abdfb5d1c15925fcb3.tar.gz
git-877f23ccb88227203f2576abdfb5d1c15925fcb3.tar.bz2
Teach "diff --check" about new blank lines at end
When a patch adds new blank lines at the end, "git apply --whitespace" warns. This teaches "diff --check" to do the same. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index b7cc6b2..0922c70 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -335,4 +335,10 @@ test_expect_success 'line numbers in --check output are correct' '
'
+test_expect_success 'checkdiff detects trailing blank lines' '
+ echo "foo();" >x &&
+ echo "" >>x &&
+ git diff --check | grep "ends with blank"
+'
+
test_done