apply --whitespace: warn blank but not necessarily empty lines at EOF
[gitweb.git] / t / t4124-apply-ws-rule.sh
index 3a77a9af87a15f9c73795afd7e27d1e29a92db32..778d45bc07b9de420ea7596655b5dbd99fc30194 100755 (executable)
@@ -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