Skip to content

Commit 48430e4

Browse files
Mroikgitster
authored andcommitted
t0008: improve test cleanup to fix failing test
The "large exclude file ignored in tree" test fails. This is due to an additional warning message that is generated in the test. "warning: unable to access 'subdir/.gitignore': Too many levels of symbolic links", the extra warning that is not supposed to be there, happens because of some leftover files left by previous tests. To fix this we improve cleanup on "symlinks not respected in-tree", and because the tests in t0008 in general have poor cleanup, at the start of "large exclude file ignored in tree" we search for any leftover .gitignore and remove them before starting the test. Improve post-test cleanup and add pre-test cleanup to make sure that we have a workable environment for the test. Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9a2fb14 commit 48430e4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

t/t0008-ignores.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ test_expect_success SYMLINKS 'symlinks respected in info/exclude' '
946946
'
947947

948948
test_expect_success SYMLINKS 'symlinks not respected in-tree' '
949-
test_when_finished "rm .gitignore" &&
949+
test_when_finished "rm -rf subdir .gitignore err actual" &&
950950
ln -s ignore .gitignore &&
951951
mkdir subdir &&
952952
ln -s ignore subdir/.gitignore &&
@@ -957,6 +957,7 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' '
957957

958958
test_expect_success EXPENSIVE 'large exclude file ignored in tree' '
959959
test_when_finished "rm .gitignore" &&
960+
find . -name .gitignore -exec rm "{}" ";" &&
960961
dd if=/dev/zero of=.gitignore bs=101M count=1 &&
961962
git ls-files -o --exclude-standard 2>err &&
962963
echo "warning: ignoring excessively large pattern file: .gitignore" >expect &&

0 commit comments

Comments
 (0)