From 2cf489a3bf75d7569c228147c3d9c559f02fd62c Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Mon, 20 Aug 2018 16:51:55 +0000 Subject: multi-pack-index: store local property A pack-file is 'local' if it is stored within the usual object directory. If it is stored in an alternate, it is non-local. Pack-files are stored using a 'pack_local' member in the packed_git struct. Add a similar 'local' member to the multi_pack_index struct and 'local' parameters to the methods that load and prepare multi- pack-indexes. Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- midx.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'midx.h') diff --git a/midx.h b/midx.h index e3b07f1586..8aa79f4b62 100644 --- a/midx.h +++ b/midx.h @@ -18,6 +18,8 @@ struct multi_pack_index { uint32_t num_packs; uint32_t num_objects; + int local; + const unsigned char *chunk_pack_names; const uint32_t *chunk_oid_fanout; const unsigned char *chunk_oid_lookup; @@ -29,14 +31,14 @@ struct multi_pack_index { char object_dir[FLEX_ARRAY]; }; -struct multi_pack_index *load_multi_pack_index(const char *object_dir); +struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local); int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result); struct object_id *nth_midxed_object_oid(struct object_id *oid, struct multi_pack_index *m, uint32_t n); int fill_midx_entry(const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m); int midx_contains_pack(struct multi_pack_index *m, const char *idx_name); -int prepare_multi_pack_index_one(struct repository *r, const char *object_dir); +int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local); int write_midx_file(const char *object_dir); void clear_midx_file(const char *object_dir); -- cgit v1.2.3