Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWincent Colaiuta <win@wincent.com>2007-12-13 16:32:29 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-14 10:43:58 +0300
commitc1795bb08aae9fb7e4dc1a01e292b85e59b1c640 (patch)
treeac058e760489ae65eb89daa910cd721492c7e64a /t/t4015-diff-whitespace.sh
parentda31b358fb39b32622c14343ffe157a765f3948b (diff)
Unify whitespace checking
This commit unifies three separate places where whitespace checking was performed: - the whitespace checking previously done in builtin-apply.c is extracted into a function in ws.c - the equivalent logic in "git diff" is removed - the emit_line_with_ws() function is also removed because that also rechecks the whitespace, and its functionality is rolled into ws.c The new function is called check_and_emit_line() and it does two things: checks a line for whitespace errors and optionally emits it. The checking is based on lines of content rather than patch lines (in other words, the caller must strip the leading "+" or "-"); this was suggested by Junio on the mailing list to allow for a future extension to "git show" to display whitespace errors in blobs. At the same time we teach it to report all classes of whitespace errors found for a given line rather than reporting only the first found error. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 757a27abdb..595cd60623 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -121,7 +121,7 @@ test_expect_success 'check mixed spaces and tabs in indent' '
# This is indented with SP HT SP.
echo " foo();" > x &&
- git diff --check | grep "space before tab"
+ git diff --check | grep "Space in indent is followed by a tab"
'