Skip to content

Commit 5f4e3bf

Browse files
Eric Wonggitster
authored andcommitted
gc: fix off-by-one error with gc.autoPackLimit
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit 5f4e3bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int too_many_packs(void)
145145
*/
146146
cnt++;
147147
}
148-
return gc_auto_pack_limit <= cnt;
148+
return gc_auto_pack_limit < cnt;
149149
}
150150

151151
static void add_repack_all_option(void)

0 commit comments

Comments
 (0)