4 #include "repository.h"
10 #define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
12 struct multi_pack_index
{
13 struct multi_pack_index
*next
;
15 const unsigned char *data
;
19 unsigned char version
;
20 unsigned char hash_len
;
21 unsigned char num_chunks
;
27 const unsigned char *chunk_pack_names
;
28 const uint32_t *chunk_oid_fanout
;
29 const unsigned char *chunk_oid_lookup
;
30 const unsigned char *chunk_object_offsets
;
31 const unsigned char *chunk_large_offsets
;
33 const char **pack_names
;
34 struct packed_git
**packs
;
35 char object_dir
[FLEX_ARRAY
];
38 #define MIDX_PROGRESS (1 << 0)
40 struct multi_pack_index
*load_multi_pack_index(const char *object_dir
, int local
);
41 int prepare_midx_pack(struct repository
*r
, struct multi_pack_index
*m
, uint32_t pack_int_id
);
42 int bsearch_midx(const struct object_id
*oid
, struct multi_pack_index
*m
, uint32_t *result
);
43 struct object_id
*nth_midxed_object_oid(struct object_id
*oid
,
44 struct multi_pack_index
*m
,
46 int fill_midx_entry(struct repository
*r
, const struct object_id
*oid
, struct pack_entry
*e
, struct multi_pack_index
*m
);
47 int midx_contains_pack(struct multi_pack_index
*m
, const char *idx_or_pack_name
);
48 int prepare_multi_pack_index_one(struct repository
*r
, const char *object_dir
, int local
);
50 int write_midx_file(const char *object_dir
, unsigned flags
);
51 void clear_midx_file(struct repository
*r
);
52 int verify_midx_file(struct repository
*r
, const char *object_dir
, unsigned flags
);
53 int expire_midx_packs(struct repository
*r
, const char *object_dir
, unsigned flags
);
54 int midx_repack(struct repository
*r
, const char *object_dir
, size_t batch_size
, unsigned flags
);
56 void close_midx(struct multi_pack_index
*m
);