]> git.ipfire.org Git - thirdparty/git.git/commit
packfile: refactor kept-pack cache to work with packfile stores
authorPatrick Steinhardt <ps@pks.im>
Fri, 9 Jan 2026 08:33:11 +0000 (09:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Jan 2026 14:40:06 +0000 (06:40 -0800)
commit085de91b951a40b2b8ce35f8bfa182d4f5bcea6b
tree75d93a0d14d0ecd56a203843dfb17267801cfa8a
parent0316c63ca4fc0d58ecd02243c62253b246fd046a
packfile: refactor kept-pack cache to work with packfile stores

The kept pack cache is a cache of packfiles that are marked as kept
either via an accompanying ".kept" file or via an in-memory flag. The
cache can be retrieved via `kept_pack_cache()`, where one needs to pass
in a repository.

Ultimately though the kept-pack cache is a property of the packfile
store, and this causes problems in a subsequent commit where we want to
move down the packfile store to be a per-object-source entity.

Prepare for this and refactor the kept-pack cache to work on top of a
packfile store instead. While at it, rename both the function and flags
specific to the kept-pack cache so that they can be properly attributed
to the respective subsystems.

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