]> Kevux Git Server - rit/commit
fsck: initialize fsck options via a function
authorPatrick Steinhardt <ps@pks.im>
Mon, 23 Mar 2026 15:02:53 +0000 (16:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Mar 2026 15:33:10 +0000 (08:33 -0700)
commitf22360902621e0807a1c0a77476e3e4d323c708d
treead15abf7edc06866b913901a3de9aee6b31218a3
parent17cabd369b5cb96bee9577f49247ef95d07058a7
fsck: initialize fsck options via a function

We initialize the `struct fsck_options` via a set of macros, often in
global scope. In the next commit though we're about to introduce a new
repository field to the options that must be initialized, and naturally
we don't have a repo other than `the_repository` available in this
scope.

Refactor the code to instead intrdouce a new `fsck_options_init()`
function that initializes the options for us and move initialization
into function scope.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
builtin/index-pack.c
builtin/mktag.c
builtin/refs.c
builtin/unpack-objects.c
fetch-pack.c
fsck.c
fsck.h
object-file.c