]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/gc: refactor to read config into structure
authorPatrick Steinhardt <ps@pks.im>
Fri, 16 Aug 2024 10:45:00 +0000 (12:45 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Aug 2024 16:46:25 +0000 (09:46 -0700)
commitd1ae15d68b44af4ef6e6caedb7aa2b2dcce03c02
tree3f8c4ba73e6c2e998659ddd9e221ec46bcde0914
parenta70a9bf6eec832b808a805de318601684b19f18e
builtin/gc: refactor to read config into structure

The git-gc(1) command knows to read a bunch of config keys to tweak its
own behaviour. The values are parsed into global variables, which makes
it hard to correctly manage the lifecycle of values that may require a
memory allocation.

Refactor the code to use a `struct gc_config` that gets populated and
passed around. For one, this makes previously-implicit dependencies on
these config values clear. Second, it will allow us to properly manage
the lifecycle in the next commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c