aboutsummaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorWincent Colaiuta <win@wincent.com>2007-12-12 17:22:59 +0100
committerJunio C Hamano <gitster@pobox.com>2007-12-12 11:24:33 -0800
commit86f8c2368523db5ee56c8856748b26c31ebeb0aa (patch)
tree67b964850ce5906c98893530f59ccff249843a22 /t/t4015-diff-whitespace.sh
parentf604652e05073aaef6d83e83b5d6499b55bb6dfd (diff)
downloadgit-86f8c2368523db5ee56c8856748b26c31ebeb0aa.tar.gz
git-86f8c2368523db5ee56c8856748b26c31ebeb0aa.tar.xz
Fix "diff --check" whitespace detection
"diff --check" would only detect spaces before tabs if a tab was the last character in the leading indent. Fix that and add a test case to make sure the bug doesn't regress in the future. 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.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 79fdff3f3..6adf9d11d 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -117,4 +117,13 @@ EOF
git diff -b > out
test_expect_success 'another test, with -b' 'git diff expect out'
+
+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"
+
+'
+
test_done