X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4019-diff-wserror.sh;h=7eae1f4500591799d656f1dde20cf15f296cf6e4;hb=bb0d283989ec8853ffd72dfb26ff557ffa7781e4;hp=0d9cbb62615c0d94da784f63907989988b0e8151;hpb=6233a5210ef64ba31bbf0e867e03e9176e0aace9;p=git.git diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh index 0d9cbb626..7eae1f450 100755 --- a/t/t4019-diff-wserror.sh +++ b/t/t4019-diff-wserror.sh @@ -13,7 +13,8 @@ test_expect_success setup ' echo " HT and SP indent" >>F && echo "With trailing SP " >>F && echo "Carriage ReturnQ" | tr Q "\015" >>F && - echo "No problem" >>F + echo "No problem" >>F && + echo >>F ' @@ -160,4 +161,21 @@ test_expect_success 'with cr-at-eol (attribute)' ' ' +test_expect_success 'trailing empty lines (1)' ' + + rm -f .gitattributes && + test_must_fail git diff --check >output && + grep "ends with blank lines." output && + grep "trailing whitespace" output + +' + +test_expect_success 'trailing empty lines (2)' ' + + echo "F -whitespace" >.gitattributes && + git diff --check >output && + ! test -s output + +' + test_done