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

[PATCH 2/5] t0001: delete repositories when object format tests finish

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 15, 2024, 08:00 UTC
Message-ID
<6b0cefef6af3a94cd3b650b2ab06de489dbdaf20.1723708417.git.ps@pks.im>
In-Reply-To
<cover.1723708417.git.ps@pks.im>

The object format tests create one-shot repositories that are only used by the respective test, but never delete them. This makes it hard to pick a proper repository name in subsequent tests, as more and more names are taken already.

Delete these repositories via `test_when_finished`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/t0001-init.sh | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 2093f5c1ee..795408e16c 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -500,6 +500,7 @@ test_expect_success 're-init from a linked worktree' '
 '
 
 test_expect_success 'init honors GIT_DEFAULT_HASH' '
+	test_when_finished "rm -rf sha1 sha256" &&
 	GIT_DEFAULT_HASH=sha1 git init sha1 &&
 	git -C sha1 rev-parse --show-object-format >actual &&
 	echo sha1 >expected &&
@@ -511,6 +512,7 @@ test_expect_success 'init honors GIT_DEFAULT_HASH' '
 '
 
 test_expect_success 'init honors --object-format' '
+	test_when_finished "rm -rf explicit-sha1 explicit-sha256" &&
 	git init --object-format=sha1 explicit-sha1 &&
 	git -C explicit-sha1 rev-parse --show-object-format >actual &&
 	echo sha1 >expected &&
@@ -522,6 +524,7 @@ test_expect_success 'init honors --object-format' '
 '
 
 test_expect_success 'extensions.objectFormat is not allowed with repo version 0' '
+	test_when_finished "rm -rf explicit-v0" &&
 	git init --object-format=sha256 explicit-v0 &&
 	git -C explicit-v0 config core.repositoryformatversion 0 &&
 	test_must_fail git -C explicit-v0 rev-parse --show-object-format
-- 
2.46.0.46.g406f326d27.dirty
Previous: Justin ToblerNext: Patrick Steinhardt
Message 4 of 24 in “Introduce configs for default repo format”
  1. 0/5 Introduce configs for default repo formatPatrick Steinhardt, Aug 15, 2024
  2. 1/5 t0001: exercise initialization with ref formats more thoroughlyPatrick Steinhardt, Aug 15, 2024
  3. Justin ToblerAug 15, 2024
  4. 2/5 t0001: delete repositories when object format tests finishPatrick Steinhardt, Aug 15, 2024
  5. 3/5 setup: merge configuration of repository formatsPatrick Steinhardt, Aug 15, 2024
  6. Justin ToblerAug 15, 2024
  7. Patrick SteinhardtAug 16, 2024
  8. 5/5 setup: make ref storage format configurable via configPatrick Steinhardt, Aug 15, 2024
  9. Justin ToblerAug 15, 2024
  10. 4/5 setup: make object format configurable via configPatrick Steinhardt, Aug 15, 2024
  11. Justin ToblerAug 15, 2024
  12. shejialuoAug 15, 2024
  13. brian m. carlsonAug 15, 2024
  14. Junio C HamanoAug 15, 2024
  15. Patrick SteinhardtAug 16, 2024
  16. brian m. carlsonAug 15, 2024
  17. 0/5 Introduce configs for default repo formatPatrick Steinhardt, Aug 16, 2024
  18. 2/5 t0001: delete repositories when object format tests finishPatrick Steinhardt, Aug 16, 2024
  19. 5/5 setup: make ref storage format configurable via configPatrick Steinhardt, Aug 16, 2024
  20. 3/5 setup: merge configuration of repository formatsPatrick Steinhardt, Aug 16, 2024
  21. 1/5 t0001: exercise initialization with ref formats more thoroughlyPatrick Steinhardt, Aug 16, 2024
  22. 4/5 setup: make object format configurable via configPatrick Steinhardt, Aug 16, 2024
  23. Junio C HamanoAug 16, 2024
  24. Justin ToblerAug 16, 2024

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.