aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-10-24 08:57:22 +0200
committerJunio C Hamano <gitster@pobox.com>2025-10-24 13:42:44 -0700
commit40a74158337f9154d26f82aa7923ca281ae131c2 (patch)
tree8fdb8002294b1225e0284d95b8df710228d21feb /t
parent0e994d9f38ebf20c8492882a12b5fbbf0415e015 (diff)
downloadgit-40a74158337f9154d26f82aa7923ca281ae131c2.tar.gz
builtin/maintenance: make "gc" strategy accessible
While the user can pick the "incremental" maintenance strategy, it is not possible to explicitly use the "gc" strategy. This has two downsides: - It is impossible to use the default "gc" strategy for a specific repository when the strategy was globally set to a different strategy. - It is not possible to use git-gc(1) for scheduled maintenance. Address these issues by making making the "gc" strategy configurable. Furthermore, extend the strategy so that git-gc(1) runs for both manual and scheduled maintenance. Signed-off-by: Patrick Steinhardt <ps@pks.im> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7900-maintenance.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 5219bc17a6..85e0cea4d9 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -915,7 +915,7 @@ test_expect_success 'maintenance.strategy is respected' '
git gc --quiet --no-detach --skip-foreground-tasks
EOF
- test_strategy incremental --schedule=weekly <<-\EOF
+ test_strategy incremental --schedule=weekly <<-\EOF &&
git pack-refs --all --prune
git prune-packed --quiet
git multi-pack-index write --no-progress
@@ -923,6 +923,18 @@ test_expect_success 'maintenance.strategy is respected' '
git multi-pack-index repack --no-progress --batch-size=1
git commit-graph write --split --reachable --no-progress
EOF
+
+ test_strategy gc <<-\EOF &&
+ git pack-refs --all --prune
+ git reflog expire --all
+ git gc --quiet --no-detach --skip-foreground-tasks
+ EOF
+
+ test_strategy gc --schedule=weekly <<-\EOF
+ git pack-refs --all --prune
+ git reflog expire --all
+ git gc --quiet --no-detach --skip-foreground-tasks
+ EOF
)
'