summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-19 19:33:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-19 19:33:57 (GMT)
commit6f3a0b6da50917569b7f29e1f387da754a6f53e9 (patch)
tree62c9040715aa1ec308032795487c460624cf4f2e /t
parenta328b2cb63c39b9df9bdc08d27ee29d80fcd768c (diff)
parentfd66bcc31ff294cdeaa3e960a3aa7fee619ec3b8 (diff)
downloadgit-6f3a0b6da50917569b7f29e1f387da754a6f53e9.zip
git-6f3a0b6da50917569b7f29e1f387da754a6f53e9.tar.gz
git-6f3a0b6da50917569b7f29e1f387da754a6f53e9.tar.bz2
Merge branch 'bw/submodule-config-cleanup'
Recent update to the submodule configuration code broke "diff-tree" by accidentally stopping to read from the index upfront. * bw/submodule-config-cleanup: diff-tree: read the index so attribute checks work in bare repositories
Diffstat (limited to 't')
-rwxr-xr-xt/t4015-diff-whitespace.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 559a754..17df491 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -636,6 +636,23 @@ test_expect_success 'check with space before tab in indent (diff-tree)' '
test_must_fail git diff-tree --check HEAD^ HEAD
'
+test_expect_success 'check with ignored trailing whitespace attr (diff-tree)' '
+ test_when_finished "git reset --hard HEAD^" &&
+
+ # create a whitespace error that should be ignored
+ echo "* -whitespace" >.gitattributes &&
+ git add .gitattributes &&
+ echo "foo(); " >x &&
+ git add x &&
+ git commit -m "add trailing space" &&
+
+ # with a worktree diff-tree ignores the whitespace error
+ git diff-tree --root --check HEAD &&
+
+ # without a worktree diff-tree still ignores the whitespace error
+ git -C .git diff-tree --root --check HEAD
+'
+
test_expect_success 'check trailing whitespace (trailing-space: off)' '
git config core.whitespace "-trailing-space" &&
echo "foo (); " >x &&