diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-05-21 01:17:35 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-27 00:48:26 +0200 |
commit | 94cd775a6c52a99caeb1278c3d8044ee109e2d3e (patch) | |
tree | 82356eb7d022d44f0bc0a290f3ffc2685fdcebb2 /object-store.h | |
parent | Documentation/technical: add cruft-packs.txt (diff) | |
download | git-94cd775a6c52a99caeb1278c3d8044ee109e2d3e.tar.xz git-94cd775a6c52a99caeb1278c3d8044ee109e2d3e.zip |
pack-mtimes: support reading .mtimes files
To store the individual mtimes of objects in a cruft pack, introduce a
new `.mtimes` format that can optionally accompany a single pack in the
repository.
The format is defined in Documentation/technical/pack-format.txt, and
stores a 4-byte network order timestamp for each object in name (index)
order.
This patch prepares for cruft packs by defining the `.mtimes` format,
and introducing a basic API that callers can use to read out individual
mtimes.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
-rw-r--r-- | object-store.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/object-store.h b/object-store.h index bd2322ed8c..3c98028ce6 100644 --- a/object-store.h +++ b/object-store.h @@ -115,12 +115,20 @@ struct packed_git { freshened:1, do_not_close:1, pack_promisor:1, - multi_pack_index:1; + multi_pack_index:1, + is_cruft:1; unsigned char hash[GIT_MAX_RAWSZ]; struct revindex_entry *revindex; const uint32_t *revindex_data; const uint32_t *revindex_map; size_t revindex_size; + /* + * mtimes_map points at the beginning of the memory mapped region of + * this pack's corresponding .mtimes file, and mtimes_size is the size + * of that .mtimes file + */ + const uint32_t *mtimes_map; + size_t mtimes_size; /* something like ".git/objects/pack/xxxxx.pack" */ char pack_name[FLEX_ARRAY]; /* more */ }; |