diff --whitespace=warn/error: obey blank-at-eof
[git/git.git] / diff.c
diff --git a/diff.c b/diff.c
index 1eddd59..a693d18 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1650,10 +1650,14 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
                ecb.priv = &data;
                xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
 
-               if ((data.ws_rule & WS_TRAILING_SPACE) &&
+               if ((data.ws_rule & WS_BLANK_AT_EOF) &&
                    data.trailing_blanks_start) {
-                       fprintf(o->file, "%s:%d: ends with blank lines.\n",
-                               data.filename, data.trailing_blanks_start);
+                       static char *err;
+
+                       if (!err)
+                               err = whitespace_error_string(WS_BLANK_AT_EOF);
+                       fprintf(o->file, "%s:%d: %s\n",
+                               data.filename, data.trailing_blanks_start, err);
                        data.status = 1; /* report errors */
                }
        }