]> git.ipfire.org Git - thirdparty/git.git/commit
setup: deduplicate logic to apply repository format
authorPatrick Steinhardt <ps@pks.im>
Tue, 26 May 2026 05:56:58 +0000 (07:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 May 2026 11:07:02 +0000 (20:07 +0900)
commit92f21def3fd5fe13a56216b56b7e1cd94a71e4b2
treecff3ec5fc4bef7125c6a79e7b37d6a6594422e09
parent1904902386e37856d85585f9a4ab1f81090f7b64
setup: deduplicate logic to apply repository format

After having discovered the repository format we then apply it to the
repository so that it knows to use the proper repository extensions. The
logic to apply the format is duplicated across three callsites, which
makes it rather painfull to add new extensions.

Introduce a new function `apply_repository_format()` that takes a repo
and applies a given format to it and adapt all callsites to use it.
While at it, rename `check_repository_format()` to clarify that it
doesn't only _check_ the format, but that it also applies it.

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