summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-16 04:30:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-16 07:06:57 (GMT)
commit0ef617f4b6ea78ad63dd11e90f8c854238176981 (patch)
treedb20846573f6e5c91d75a99041ce796d8005d0f6 /t
parent13bf1a99764ea751f6fa75502309d8b91529623a (diff)
downloadgit-0ef617f4b6ea78ad63dd11e90f8c854238176981.zip
git-0ef617f4b6ea78ad63dd11e90f8c854238176981.tar.gz
git-0ef617f4b6ea78ad63dd11e90f8c854238176981.tar.bz2
diff: Fix miscounting of --check output
c1795bb (Unify whitespace checking) incorrectly made the checking function return without incrementing the line numbers when there is no whitespace problem is found on a '+' line. This resurrects the earlier behaviour. Noticed and reported by Jay Soffian. The test script was stolen from Jay's independent fix. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4015-diff-whitespace.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index d30169f..83c54b7 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -326,4 +326,13 @@ test_expect_success 'check tabs and spaces as indentation (indent-with-non-tab:
! git diff --check
'
+
+test_expect_success 'line numbers in --check output are correct' '
+
+ echo "" > x &&
+ echo "foo(); " >> x &&
+ git diff --check | grep "x:2:"
+
+'
+
test_done