diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2019-03-14 00:54:35 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-03-14 13:55:28 +0900 |
| commit | 8bf14444c3989aa0f5b01ba67dfb4b592e6c30d3 (patch) | |
| tree | 96a015aa2d312ea9e31cd12d6b9649bab54e0d51 /builtin/commit-tree.c | |
| parent | The second batch (diff) | |
| download | git-8bf14444c3989aa0f5b01ba67dfb4b592e6c30d3.tar.gz git-8bf14444c3989aa0f5b01ba67dfb4b592e6c30d3.zip | |
gc: remove redundant check for gc_auto_threshold
Checking gc_auto_threshold in too_many_loose_objects() was added in
17815501a8 ("git-gc --auto: run "repack -A -d -l" as necessary.",
2007-09-17) when need_to_gc() itself was also reliant on
gc_auto_pack_limit before its early return:
gc_auto_threshold <= 0 && gc_auto_pack_limit <= 0
When that check was simplified to just checking "gc_auto_threshold <=
0" in b14d255ba8 ("builtin-gc.c: allow disabling all auto-gc'ing by
assigning 0 to gc.auto", 2008-03-19) this unreachable code should have
been removed. We only call too_many_loose_objects() from within
need_to_gc() itself, which will return if this condition holds, and in
cmd_gc() which will return before ever getting to "auto_gc &&
too_many_loose_objects()" if "auto_gc && !need_to_gc()" is true
earlier in the function.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-tree.c')
0 files changed, 0 insertions, 0 deletions
