File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -352,6 +352,48 @@ test_expect_success 'check tabs and spaces as indentation (indent-with-non-tab:
352352
353353'
354354
355+ test_expect_success ' check tabs as indentation (tab-in-indent: off)' '
356+
357+ git config core.whitespace "-tab-in-indent" &&
358+ echo " foo ();" > x &&
359+ git diff --check
360+
361+ '
362+
363+ test_expect_success ' check tabs as indentation (tab-in-indent: on)' '
364+
365+ git config core.whitespace "tab-in-indent" &&
366+ echo " foo ();" > x &&
367+ test_must_fail git diff --check
368+
369+ '
370+
371+ test_expect_success ' check tabs and spaces as indentation (tab-in-indent: on)' '
372+
373+ git config core.whitespace "tab-in-indent" &&
374+ echo " foo ();" > x &&
375+ test_must_fail git diff --check
376+
377+ '
378+
379+ test_expect_success ' check tab-in-indent and indent-with-non-tab conflict' '
380+
381+ git config core.whitespace "tab-in-indent,indent-with-non-tab" &&
382+ echo "foo ();" > x &&
383+ test_must_fail git diff --check
384+
385+ '
386+
387+ test_expect_success ' check tab-in-indent excluded from wildcard whitespace attribute' '
388+
389+ git config --unset core.whitespace &&
390+ echo "x whitespace" > .gitattributes &&
391+ echo " foo ();" > x &&
392+ git diff --check &&
393+ rm -f .gitattributes
394+
395+ '
396+
355397test_expect_success ' line numbers in --check output are correct' '
356398
357399 echo "" > x &&
You can’t perform that action at this time.
0 commit comments