t0001: delete repositories when object format tests finish
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Aug 16, 2024 at 10:56 UTC
7689f6cbd11cbfd0828a77a5fb070d5a2f06edc7
1 file changed
+3
t/t0001-init.sh
+3
@@ -500,6 +500,7 @@ test_expect_success 're-init from a linked worktree' '
500
'
501
502
test_expect_success 'init honors GIT_DEFAULT_HASH' '
503
+ test_when_finished "rm -rf sha1 sha256" &&
504
GIT_DEFAULT_HASH=sha1 git init sha1 &&
505
git -C sha1 rev-parse --show-object-format >actual &&
506
echo sha1 >expected &&
@@ -511,6 +512,7 @@ test_expect_success 'init honors GIT_DEFAULT_HASH' '
512
'
513
514
test_expect_success 'init honors --object-format' '
515
+ test_when_finished "rm -rf explicit-sha1 explicit-sha256" &&
516
git init --object-format=sha1 explicit-sha1 &&
517
git -C explicit-sha1 rev-parse --show-object-format >actual &&
518
echo sha1 >expected &&
@@ -522,6 +524,7 @@ test_expect_success 'init honors --object-format' '
524
'
525
526
test_expect_success 'extensions.objectFormat is not allowed with repo version 0' '
527
+ test_when_finished "rm -rf explicit-v0" &&
528
git init --object-format=sha256 explicit-v0 &&
529
git -C explicit-v0 config core.repositoryformatversion 0 &&
530
test_must_fail git -C explicit-v0 rev-parse --show-object-format