diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-03-30 15:04:29 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-01 20:07:37 (GMT) |
commit | a587b5a7869e9a399d4de6edea0b3f32a3548639 (patch) | |
tree | 09ee4e3b51517962644de579bb7dd1486dbab32a /pack.h | |
parent | f894081deae88e875536bd53c56b8b189474770c (diff) | |
download | git-a587b5a7869e9a399d4de6edea0b3f32a3548639.zip git-a587b5a7869e9a399d4de6edea0b3f32a3548639.tar.gz git-a587b5a7869e9a399d4de6edea0b3f32a3548639.tar.bz2 |
pack-write.c: extract 'write_rev_file_order'
Existing callers provide the reverse index code with an array of 'struct
pack_idx_entry *'s, which is then sorted by pack order (comparing the
offsets of each object within the pack).
Prepare for the multi-pack index to write a .rev file by providing a way
to write the reverse index without an array of pack_idx_entry (which the
MIDX code does not have).
Instead, callers can invoke 'write_rev_index_positions()', which takes
an array of uint32_t's. The ith entry in this array specifies the ith
object's (in index order) position within the pack (in pack order).
Expose this new function for use in a later patch, and rewrite the
existing write_rev_file() in terms of this new function.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack.h')
-rw-r--r-- | pack.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -94,6 +94,7 @@ struct ref; void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought); const char *write_rev_file(const char *rev_name, struct pack_idx_entry **objects, uint32_t nr_objects, const unsigned char *hash, unsigned flags); +const char *write_rev_file_order(const char *rev_name, uint32_t *pack_order, uint32_t nr_objects, const unsigned char *hash, unsigned flags); /* * The "hdr" output buffer should be at least this big, which will handle sizes |