aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2022-11-08 17:14:48 -0500
committerTaylor Blau <me@ttaylorr.com>2022-11-08 17:14:48 -0500
commitbdd42e34e3fdca79e20e30bcc03e99138e59c992 (patch)
tree5d2d069ae20b54ff4f0006e63306dec30245e355 /builtin/gc.c
parent098b1d07bce86358d0d3aeb2ea6f1932362709b0 (diff)
parentc695592850a3b4b7857fc11721cbc7d2b332f41e (diff)
downloadgit-bdd42e34e3fdca79e20e30bcc03e99138e59c992.tar.gz
Merge branch 'es/mark-gc-cruft-as-experimental'
Enable gc.cruftpacks by default for those who opt into feature.experimental setting. * es/mark-gc-cruft-as-experimental: config: let feature.experimental imply gc.cruftPacks=true gc: add tests for --cruft and friends
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 24ea85c7af..59fc785d1f 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -42,7 +42,7 @@ static const char * const builtin_gc_usage[] = {
static int pack_refs = 1;
static int prune_reflogs = 1;
-static int cruft_packs = 0;
+static int cruft_packs = -1;
static int aggressive_depth = 50;
static int aggressive_window = 250;
static int gc_auto_threshold = 6700;
@@ -593,6 +593,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
if (prune_expire && parse_expiry_date(prune_expire, &dummy))
die(_("failed to parse prune expiry value %s"), prune_expire);
+ prepare_repo_settings(the_repository);
+ if (cruft_packs < 0)
+ cruft_packs = the_repository->settings.gc_cruft_packs;
+
if (aggressive) {
strvec_push(&repack, "-f");
if (aggressive_depth > 0)
@@ -704,7 +708,6 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
clean_pack_garbage();
}
- prepare_repo_settings(the_repository);
if (the_repository->settings.gc_write_commit_graph == 1)
write_commit_graph_reachable(the_repository->objects->odb,
!quiet && !daemonized ? COMMIT_GRAPH_WRITE_PROGRESS : 0,