]> Kevux Git Server - rit/commit
builtin/fsck: stop using `the_repository` when checking packed objects
authorPatrick Steinhardt <ps@pks.im>
Mon, 23 Mar 2026 15:03:01 +0000 (16:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Mar 2026 15:33:11 +0000 (08:33 -0700)
commit1c5f77b6103adae5d45ae9ff24e9945b8f8b76c8
treed51e0fb5fea98904abb72ea508c340d303865ca4
parent2b2287c479ced6f794a7c8d305c39eef4ee563f5
builtin/fsck: stop using `the_repository` when checking packed objects

We implicitly rely on `the_repository` when checking objects part of a
packfile. These objects are iterated over via `verify_pack()`, which is
provided by the packfile subsystem, and a callback function is then
invoked for each of the objects in that specific pack.

Unfortunately, it is not possible to provide a payload to the callback
function. Refactor `verify_pack()` to accept a payload that is passed
through to the callback so that we can inject the repository and get rid
of the use of `the_repository`.

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