diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/gc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index 63d400bcb2..72aa91206d 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -26,6 +26,7 @@ static const char * const builtin_gc_usage[] = { }; static int pack_refs = 1; +static int aggressive_depth = 250; static int aggressive_window = 250; static int gc_auto_threshold = 6700; static int gc_auto_pack_limit = 50; @@ -66,6 +67,10 @@ static int gc_config(const char *var, const char *value, void *cb) aggressive_window = git_config_int(var, value); return 0; } + if (!strcmp(var, "gc.aggressivedepth")) { + aggressive_depth = git_config_int(var, value); + return 0; + } if (!strcmp(var, "gc.auto")) { gc_auto_threshold = git_config_int(var, value); return 0; @@ -294,7 +299,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix) if (aggressive) { argv_array_push(&repack, "-f"); - argv_array_push(&repack, "--depth=250"); + if (aggressive_depth > 0) + argv_array_pushf(&repack, "--depth=%d", aggressive_depth); if (aggressive_window > 0) argv_array_pushf(&repack, "--window=%d", aggressive_window); } |