summaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorChris Webb <chris@arachsys.com>2010-04-02 23:37:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-04-04 21:21:00 (GMT)
commitb27eb49948c90af11cee39301d03c37a05e066de (patch)
tree4cf7c04560777a8e83844814620ee9c0de028b0c /t/t4015-diff-whitespace.sh
parent3e3ec2abe0f275dda285e989224e4c3da19e7adb (diff)
downloadgit-b27eb49948c90af11cee39301d03c37a05e066de.zip
git-b27eb49948c90af11cee39301d03c37a05e066de.tar.gz
git-b27eb49948c90af11cee39301d03c37a05e066de.tar.bz2
whitespace: tests for git-diff --check with tab-in-indent error class
[jc: with test fixes from J6t] Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 90f3342..e92eab0 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -352,6 +352,48 @@ test_expect_success 'check tabs and spaces as indentation (indent-with-non-tab:
'
+test_expect_success 'check tabs as indentation (tab-in-indent: off)' '
+
+ git config core.whitespace "-tab-in-indent" &&
+ echo " foo ();" > x &&
+ git diff --check
+
+'
+
+test_expect_success 'check tabs as indentation (tab-in-indent: on)' '
+
+ git config core.whitespace "tab-in-indent" &&
+ echo " foo ();" > x &&
+ test_must_fail git diff --check
+
+'
+
+test_expect_success 'check tabs and spaces as indentation (tab-in-indent: on)' '
+
+ git config core.whitespace "tab-in-indent" &&
+ echo " foo ();" > x &&
+ test_must_fail git diff --check
+
+'
+
+test_expect_success 'check tab-in-indent and indent-with-non-tab conflict' '
+
+ git config core.whitespace "tab-in-indent,indent-with-non-tab" &&
+ echo "foo ();" > x &&
+ test_must_fail git diff --check
+
+'
+
+test_expect_success 'check tab-in-indent excluded from wildcard whitespace attribute' '
+
+ git config --unset core.whitespace &&
+ echo "x whitespace" > .gitattributes &&
+ echo " foo ();" > x &&
+ git diff --check &&
+ rm -f .gitattributes
+
+'
+
test_expect_success 'line numbers in --check output are correct' '
echo "" > x &&