Use shorter error messages for whitespace problems
The initial version of the whitespace_error_string() function took the messages from builtin-apply.c rather than the shorter messages from diff.c. This commit addresses Junio's concern that these messages might be too long (now that we can emit multiple warnings per line). Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Wincent Colaiuta committed
Dec 14, 2007 at 12:23 UTC
420f4f04de9b3790da695918ac168d4115665d92
2 files changed
+4
-4
t/t4015-diff-whitespace.sh
+1
-1
@@ -121,7 +121,7 @@ test_expect_success 'check mixed spaces and tabs in indent' '
121
122
# This is indented with SP HT SP.
123
echo " foo();" > x &&
124
- git diff --check | grep "Space in indent is followed by a tab"
124
+ git diff --check | grep "space before tab in indent"
125
126
'
127
ws.c
+3
-3
@@ -101,16 +101,16 @@ char *whitespace_error_string(unsigned ws)
101
struct strbuf err;
102
strbuf_init(&err, 0);
103
if (ws & WS_TRAILING_SPACE)
104
- strbuf_addstr(&err, "Adds trailing whitespace");
104
+ strbuf_addstr(&err, "trailing whitespace");
105
if (ws & WS_SPACE_BEFORE_TAB) {
106
if (err.len)
107
strbuf_addstr(&err, ", ");
108
- strbuf_addstr(&err, "Space in indent is followed by a tab");
108
+ strbuf_addstr(&err, "space before tab in indent");
109
}
110
if (ws & WS_INDENT_WITH_NON_TAB) {
111
if (err.len)
112
strbuf_addstr(&err, ", ");
113
- strbuf_addstr(&err, "Indent more than 8 places with spaces");
113
+ strbuf_addstr(&err, "indent with spaces");
114
}
115
return strbuf_detach(&err, NULL);
116
}