Skip to content

Commit

Permalink
builtin-gc.c: allow disabling all auto-gc'ing by assigning 0 to gc.auto
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Mar 20, 2008
1 parent 02b00e1 commit b14d255
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ static int too_many_packs(void)
static int need_to_gc(void)
{
/*
* Setting gc.auto and gc.autopacklimit to 0 or negative can
* disable the automatic gc.
* Setting gc.auto to 0 or negative can disable the
* automatic gc.
*/
if (gc_auto_threshold <= 0 && gc_auto_pack_limit <= 0)
if (gc_auto_threshold <= 0)
return 0;

/*
Expand Down

0 comments on commit b14d255

Please sign in to comment.