builtin-gc.c: allow disabling all auto-gc'ing by assigning 0 to gc.auto
The gc.auto configuration variable is somewhat ambiguous now that there is also a gc.autopacklimit setting. Some users may assume that it controls all auto-gc'ing. Also, now users must set two configuration variables to zero when they want to disable autopacking. Since it is unlikely that users will want to autopack based on some threshold of pack files when they have disabled autopacking based on the number of loose objects, be nice and allow a setting of zero for gc.auto to disable all autopacking. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
Mar 19, 2008 at 16:53 UTC
b14d255ba8362a4debe51dc67d6b98d06fdc36aa
1 file changed
+3
-3
builtin-gc.c
+3
-3
@@ -160,10 +160,10 @@ static int too_many_packs(void)
160
static int need_to_gc(void)
161
{
162
/*
163
- * Setting gc.auto and gc.autopacklimit to 0 or negative can
164
- * disable the automatic gc.
163
+ * Setting gc.auto to 0 or negative can disable the
164
+ * automatic gc.
165
*/
166
- if (gc_auto_threshold <= 0 && gc_auto_pack_limit <= 0)
166
+ if (gc_auto_threshold <= 0)
167
return 0;
168
169
/*