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

[GSoC PATCH 2/3] t5516: clean up cloned and new-wt in denyCurrentBranch and worktrees test

From
Pablo Sabater <pabloosabaterr@gmail.com>
Date
Mar 30, 2026, 11:18 UTC
Message-ID
<20260330111822.165188-3-pabloosabaterr@gmail.com>
In-Reply-To
<20260330111822.165188-1-pabloosabaterr@gmail.com>

The 'denyCurrentBranch and worktrees' test creates a 'cloned' and a 'new-wt' but it doesn't clean them after the test. This makes other tests that use the same name after this one to fail.

Add test_when_finished to clean them at the end.
Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
---
 t/t5516-fetch-push.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index f44250c38f..c40f2790d8 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1792,6 +1792,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 '
 
 test_expect_success 'denyCurrentBranch and worktrees' '
+	test_when_finished "rm -fr cloned && git worktree remove --force new-wt" &&
 	git worktree add new-wt &&
 	git clone . cloned &&
 	test_commit -C cloned first &&
-- 
2.43.0
Previous: Pablo SabaterNext: Pablo Sabater
Message 7 of 11 in “t5516: test updateInstead with worktree and unborn bare HEAD”
  1. t5516: test updateInstead with worktree and unborn bare HEADRunxi Yu, Feb 23, 2026
  2. Junio C HamanoFeb 23, 2026
  3. Runxi YuFeb 24, 2026
  4. Runxi YuMar 3, 2026
  5. 0/3 receive-pack: fix HEAD check for updateInsteadPablo Sabater, Mar 30, 2026
  6. 1/3 t5516: test updateInstead with worktree and unborn bare HEADPablo Sabater, Mar 30, 2026
  7. 2/3 t5516: clean up cloned and new-wt in denyCurrentBranch and worktrees testPablo Sabater, Mar 30, 2026
  8. 3/3 receive-pack: use worktree HEAD for updateInsteadPablo Sabater, Mar 30, 2026
  9. Junio C HamanoMar 30, 2026
  10. PabloMar 30, 2026
  11. Junio C HamanoMar 31, 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.