From 2d4403cf9972f8ae78aa52fe6ce7a01d9b6757c1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 31 Jan 2019 00:32:42 +0000 Subject: inbox: perform cleanup of Git objects for coderepos Otherwise, long-running but idle git processes may keep unlinked packs around indefinitely and waste disk space. --- t/git.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't') diff --git a/t/git.t b/t/git.t index 9c80fbb4..d637e63b 100644 --- a/t/git.t +++ b/t/git.t @@ -142,6 +142,10 @@ if ('alternates reloaded') { open $fh, '<', "$alt/config" or die "open failed: $!\n"; my $config = eval { local $/; <$fh> }; is($$found, $config, 'alternates reloaded'); + + ok($gcf->cleanup(time - 30), 'cleanup did not expire'); + ok(!$gcf->cleanup(time + 30), 'cleanup can expire'); + ok(!$gcf->cleanup, 'cleanup idempotent'); } use_ok 'PublicInbox::Git', qw(git_unquote git_quote); -- cgit v1.2.3-24-ge0c7