git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] t0008: improve test cleanup to fix failing test

From
Mirko Faina <mroik@delayed.space>
Date
Mar 16, 2026, 01:15 UTC
Message-ID
<20260316011544.13825-1-mroik@delayed.space>
In-Reply-To
<20260315034851.2261530-1-mroik@delayed.space>

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>
---
Sorry again for the poorly written commit message in the previous patch.
 t/t0008-ignores.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index db8bde280e..e716b5cdfa 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -946,7 +946,7 @@ test_expect_success SYMLINKS 'symlinks respected in info/exclude' '
 '
 
 test_expect_success SYMLINKS 'symlinks not respected in-tree' '
-	test_when_finished "rm .gitignore" &&
+	test_when_finished "rm -rf subdir .gitignore err actual" &&
 	ln -s ignore .gitignore &&
 	mkdir subdir &&
 	ln -s ignore subdir/.gitignore &&
@@ -957,6 +957,7 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' '
 
 test_expect_success EXPENSIVE 'large exclude file ignored in tree' '
 	test_when_finished "rm .gitignore" &&
+	find . -name .gitignore -exec rm "{}" ";" &&
 	dd if=/dev/zero of=.gitignore bs=101M count=1 &&
 	git ls-files -o --exclude-standard 2>err &&
 	echo "warning: ignoring excessively large pattern file: .gitignore" >expect &&
-- 
2.53.0.959.g497ff81fa9
Previous: Junio C HamanoNext: Mirko Faina
Message 5 of 7 in “t0008: fix "large exclude file ignored in tree"”
  1. t0008: fix "large exclude file ignored in tree"Mirko Faina, Mar 15, 2026
  2. Junio C HamanoMar 15, 2026
  3. Mirko FainaMar 15, 2026
  4. Junio C HamanoMar 15, 2026
  5. t0008: improve test cleanup to fix failing testMirko Faina, Mar 16, 2026
  6. Mirko FainaMar 16, 2026
  7. Junio C HamanoMar 16, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.