mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
odb: move kept cache into struct packfile_store
The object database tracks a cache of "kept" packfiles, which is used by git-pack-objects(1) to handle cruft objects. With the introduction of the `struct packfile_store` we have a better place to host this cache though. Move the cache accordingly. This moves the last bit of packfile-related state from the object database into the packfile store. Adapt the comment for the `packfiles` pointer in `struct object_database` to reflect this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
fe835b0ca0
commit
bd1a521de8
14
packfile.h
14
packfile.h
@@ -64,6 +64,20 @@ struct packfile_store {
|
||||
*/
|
||||
struct packed_git *packs;
|
||||
|
||||
/*
|
||||
* Cache of packfiles which are marked as "kept", either because there
|
||||
* is an on-disk ".keep" file or because they are marked as "kept" in
|
||||
* memory.
|
||||
*
|
||||
* Should not be accessed directly, but via `kept_pack_cache()`. The
|
||||
* list of packs gets invalidated when the stored flags and the flags
|
||||
* passed to `kept_pack_cache()` mismatch.
|
||||
*/
|
||||
struct {
|
||||
struct packed_git **packs;
|
||||
unsigned flags;
|
||||
} kept_cache;
|
||||
|
||||
/* A most-recently-used ordered version of the packs list. */
|
||||
struct list_head mru;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user