]> git.ipfire.org Git - thirdparty/git.git/commit
setup: merge configuration of repository formats
authorPatrick Steinhardt <ps@pks.im>
Fri, 16 Aug 2024 08:56:58 +0000 (10:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Aug 2024 16:55:21 +0000 (09:55 -0700)
commit39e15b789ad3c3a192f4c8abde3daff83a053aaa
tree4dda7d4aa00f999010b9fbb5ef39fd1200da2533
parent7689f6cbd11cbfd0828a77a5fb070d5a2f06edc7
setup: merge configuration of repository formats

The configuration of repository formats is split up across two functions
`validate_hash_algorithm()` and `validate_ref_storage_format()`. This is
fine as-is, but we are about to extend the logic to also read default
values from the config. With the logic split across two functions, we
would either have to pass in additional parameters read from the config,
or read the config multiple times. Both of these options feel a bit
unwieldy.

Merge the code into a new function `repository_format_configure()` that
is responsible for configuring the whole repository's format. Like this,
we can easily read the config in a single place, only.

Furthermore, move the calls to `repo_set_ref_storage_format()` and
`repo_set_hash_algo()` into this new function as well, such that all the
logic to configure the repository format is self-contained here.

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