diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-09-04 02:25:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-09-04 11:50:26 -0700 |
commit | 94ea026b358f9fd5395d9344a80f2d5a50e93e1f (patch) | |
tree | bbb48ff8199ac4687ebda43b0639b93be7145422 /t/t4124-apply-ws-rule.sh | |
parent | 77b15bbd88e2f48de093ff0e60de6dbc11e3329e (diff) | |
download | git-94ea026b358f9fd5395d9344a80f2d5a50e93e1f.tar.gz |
apply --whitespace: warn blank but not necessarily empty lines at EOF
The whitespace error of adding blank lines at the end of file should
trigger if you added a non-empty line at the end, if the contents of the
line is full of whitespaces.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4124-apply-ws-rule.sh')
-rwxr-xr-x | t/t4124-apply-ws-rule.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh index 3a77a9af87..778d45bc07 100755 --- a/t/t4124-apply-ws-rule.sh +++ b/t/t4124-apply-ws-rule.sh @@ -227,4 +227,17 @@ test_expect_success 'blank at EOF with --whitespace=error' ' grep "new blank line at EOF" error ' +test_expect_success 'blank but not empty at EOF' ' + { echo a; echo b; echo c; } >one && + git add one && + echo " " >>one && + cat one >expect && + git diff -- one >patch && + + git checkout one && + git apply --whitespace=warn patch 2>error && + test_cmp expect one && + grep "new blank line at EOF" error +' + test_done |