]> git.ipfire.org Git - thirdparty/git.git/commit
packfile: split up responsibilities of `reprepare_packed_git()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 23 Sep 2025 10:17:08 +0000 (12:17 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Sep 2025 18:53:50 +0000 (11:53 -0700)
commit78237ea53d6546aeab7adb2c7547a1177311ccde
treebfc9bf24d14901380ec2c81b9d44ca342ad12fa4
parentc36ecc0685a75f913fe4871766715221c71f4b09
packfile: split up responsibilities of `reprepare_packed_git()`

In `reprepare_packed_git()` we perform a couple of operations:

  - We reload alternate object directories.

  - We clear the loose object cache.

  - We reprepare packfiles.

While the logic is hosted in "packfile.c", it clearly reaches into other
subsystems that aren't related to packfiles.

Split up the responsibility and introduce `odb_reprepare()` which now
becomes responsible for repreparing the whole object database. The
existing `reprepare_packed_git()` function is refactored accordingly and
only cares about reloading the packfile store now.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 files changed:
builtin/backfill.c
builtin/gc.c
builtin/receive-pack.c
builtin/repack.c
bulk-checkin.c
connected.c
fetch-pack.c
object-name.c
odb.c
odb.h
packfile.c
packfile.h
transport-helper.c