]> git.99rst.org Git - git.git/commit
builtin/gc: introduce `odb_optimize_required()`
authorPatrick Steinhardt <redacted>
Mon, 13 Jul 2026 05:52:12 +0000 (07:52 +0200)
committerJunio C Hamano <redacted>
Mon, 13 Jul 2026 15:13:16 +0000 (08:13 -0700)
commit841ca632be7ad515c4e8f0d5b4ab2cba7454f402
tree03c19072647f873d9443ef896e6588a09be39d28
parent7d663dd83ba2ae459178c98f96c0761d044698b4
builtin/gc: introduce `odb_optimize_required()`

When invoking either git-gc(1) or git-maintenance(1) with the "--auto"
flag then we only perform those maintenance tasks that are actually
required. This logic is inherently an implementation detail of the
object database backend that's in use. But the logic is scattered around
multiple different functions, which makes it hard to make the logic
pluggable.

Introduce a new `odb_optimize_required()` function that allows us to
check these conditions in a generic way.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/gc.c
git clone https://git.99rst.org/PROJECT