]> Kevux Git Server - rit/commit
odb: get rid of `the_repository` when handling alternates
authorPatrick Steinhardt <ps@pks.im>
Tue, 1 Jul 2025 12:22:20 +0000 (14:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Jul 2025 21:46:36 +0000 (14:46 -0700)
commitc44185f6c10fb2d306efe505112982a7c3b93789
tree98e2f1411a2f14a3be954f8ef16f0ccf78d77005
parent1b1679c6883f948b19599f11229ff61124b51733
odb: get rid of `the_repository` when handling alternates

The functions to manage alternates all depend on `the_repository`.
Refactor them to accept an object database as a parameter and adjust all
callers. The functions are renamed accordingly.

Note that right now the situation is still somewhat weird because we end
up using the object store path provided by the object store's repository
anyway. Consequently, we could have instead passed in a pointer to the
repository instead of passing in the pointer to the object store. This
will be addressed in subsequent commits though, where we will start to
use the path owned by the object store itself.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 files changed:
builtin/clone.c
builtin/fsck.c
builtin/grep.c
builtin/repack.c
commit-graph.c
loose.c
object-file.c
object-name.c
odb.c
odb.h
packfile.c
submodule.c
t/helper/test-ref-store.c
tmp-objdir.c