git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gc: fix off-by-one error with gc.autoPackLimit

From
EWEric Wong <e@80x24.org>
Date
Jun 25, 2016, 06:46 UTC
Message-ID
<20160625064647.GA20659@dcvr.yhbt.net>
In-Reply-To
<xmqqa8i9eqwn.fsf@gitster.mtv.corp.google.com>

This matches the documentation and allows gc.autoPackLimit=1 to maintain a single pack without attempting a repack on every "git gc --auto" invocation.

Signed-off-by: Eric Wong <e@80x24.org>
---
 builtin/gc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/gc.c b/builtin/gc.c
index c583aad..332bcf7 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -177,7 +177,7 @@ static int too_many_packs(void)
 		 */
 		cnt++;
 	}
-	return gc_auto_pack_limit <= cnt;
+	return gc_auto_pack_limit < cnt;
 }
 
 static void add_repack_all_option(void)
-- 
EW
Previous: Junio C HamanoNext: Jeff King
Message 5 of 6 in “[RFC] gc: correct gc.autoPackLimit documentation”
  1. Eric WongJun 25, 2016
  2. Jeff KingJun 25, 2016
  3. Eric WongJun 25, 2016
  4. Junio C HamanoJun 25, 2016
  5. gc: fix off-by-one error with gc.autoPackLimitEric Wong, Jun 25, 2016
  6. Jeff KingJun 27, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.