Skip to content

Commit 7689f6c

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 05d2091 commit 7689f6c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

t/t0001-init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ test_expect_success 're-init from a linked worktree' '
500500
'
501501

502502
test_expect_success 'init honors GIT_DEFAULT_HASH' '
503+
test_when_finished "rm -rf sha1 sha256" &&
503504
GIT_DEFAULT_HASH=sha1 git init sha1 &&
504505
git -C sha1 rev-parse --show-object-format >actual &&
505506
echo sha1 >expected &&
@@ -511,6 +512,7 @@ test_expect_success 'init honors GIT_DEFAULT_HASH' '
511512
'
512513

513514
test_expect_success 'init honors --object-format' '
515+
test_when_finished "rm -rf explicit-sha1 explicit-sha256" &&
514516
git init --object-format=sha1 explicit-sha1 &&
515517
git -C explicit-sha1 rev-parse --show-object-format >actual &&
516518
echo sha1 >expected &&
@@ -522,6 +524,7 @@ test_expect_success 'init honors --object-format' '
522524
'
523525

524526
test_expect_success 'extensions.objectFormat is not allowed with repo version 0' '
527+
test_when_finished "rm -rf explicit-v0" &&
525528
git init --object-format=sha256 explicit-v0 &&
526529
git -C explicit-v0 config core.repositoryformatversion 0 &&
527530
test_must_fail git -C explicit-v0 rev-parse --show-object-format

0 commit comments

Comments
 (0)