859
return p;
860
}
861
862
-void packfile_store_add_pack(struct packfile_store *store,
862
+void packfile_store_add_pack(struct odb_source_packed *store,
863
struct packed_git *pack)
864
{
865
if (pack->pack_fd != -1)
869
strmap_put(&store->packs_by_path, pack->pack_name, pack);
870
}
871
872
-struct packed_git *packfile_store_load_pack(struct packfile_store *store,
872
+struct packed_git *packfile_store_load_pack(struct odb_source_packed *store,
873
const char *idx_path, int local)
874
{
875
struct strbuf key = STRBUF_INIT;
1068
return -1;
1069
}
1070
1071
-void packfile_store_prepare(struct packfile_store *store)
1071
+void packfile_store_prepare(struct odb_source_packed *store)
1072
{
1073
if (store->initialized)
1074
return;
1084
store->initialized = true;
1085
}
1086
1087
-void packfile_store_reprepare(struct packfile_store *store)
1087
+void packfile_store_reprepare(struct odb_source_packed *store)
1088
{
1089
store->initialized = false;
1090
packfile_store_prepare(store);
1091
}
1092
1093
-struct packfile_list_entry *packfile_store_get_packs(struct packfile_store *store)
1093
+struct packfile_list_entry *packfile_store_get_packs(struct odb_source_packed *store)
1094
{
1095
packfile_store_prepare(store);
1096
1103
return store->packs.head;
1104
}
1105
1106
-int packfile_store_count_objects(struct packfile_store *store,
1106
+int packfile_store_count_objects(struct odb_source_packed *store,
1107
enum odb_count_objects_flags flags UNUSED,
1108
unsigned long *out)
1109
{
2160
return 1;
2161
}
2162
2163
-static int find_pack_entry(struct packfile_store *store,
2163
+static int find_pack_entry(struct odb_source_packed *store,
2164
const struct object_id *oid,
2165
struct pack_entry *e)
2166
{
2183
return 0;
2184
}
2185
2186
-int packfile_store_freshen_object(struct packfile_store *store,
2186
+int packfile_store_freshen_object(struct odb_source_packed *store,
2187
const struct object_id *oid)
2188
{
2189
struct pack_entry e;
2199
return 1;
2200
}
2201
2202
-int packfile_store_read_object_info(struct packfile_store *store,
2202
+int packfile_store_read_object_info(struct odb_source_packed *store,
2203
const struct object_id *oid,
2204
struct object_info *oi,
2205
enum object_info_flags flags)
2234
return 0;
2235
}
2236
2237
-static void maybe_invalidate_kept_pack_cache(struct packfile_store *store,
2237
+static void maybe_invalidate_kept_pack_cache(struct odb_source_packed *store,
2238
unsigned flags)
2239
{
2240
if (!store->kept_cache.packs)
2245
store->kept_cache.flags = 0;
2246
}
2247
2248
-struct packed_git **packfile_store_get_kept_pack_cache(struct packfile_store *store,
2248
+struct packed_git **packfile_store_get_kept_pack_cache(struct odb_source_packed *store,
2249
unsigned flags)
2250
{
2251
maybe_invalidate_kept_pack_cache(store, flags);
2365
return r;
2366
}
2367
2368
-struct packfile_store_for_each_object_wrapper_data {
2369
- struct packfile_store *store;
2368
+struct odb_source_packed_for_each_object_wrapper_data {
2369
+ struct odb_source_packed *store;
2370
const struct object_info *request;
2371
odb_for_each_object_cb cb;
2372
void *cb_data;
2377
uint32_t index_pos,
2378
void *cb_data)
2379
{
2380
- struct packfile_store_for_each_object_wrapper_data *data = cb_data;
2380
+ struct odb_source_packed_for_each_object_wrapper_data *data = cb_data;
2381
2382
if (data->request) {
2383
off_t offset = nth_packed_object_offset(pack, index_pos);
2411
}
2412
2413
static int for_each_prefixed_object_in_midx(
2414
- struct packfile_store *store,
2414
+ struct odb_source_packed *store,
2415
struct multi_pack_index *m,
2416
const struct odb_for_each_object_options *opts,
2417
- struct packfile_store_for_each_object_wrapper_data *data)
2417
+ struct odb_source_packed_for_each_object_wrapper_data *data)
2418
{
2419
int ret;
2420
2470
}
2471
2472
static int for_each_prefixed_object_in_pack(
2473
- struct packfile_store *store,
2473
+ struct odb_source_packed *store,
2474
struct packed_git *p,
2475
const struct odb_for_each_object_options *opts,
2476
- struct packfile_store_for_each_object_wrapper_data *data)
2476
+ struct odb_source_packed_for_each_object_wrapper_data *data)
2477
{
2478
uint32_t num, i, first = 0;
2479
int len = opts->prefix_hex_len > p->repo->hash_algo->hexsz ?
2519
}
2520
2521
static int packfile_store_for_each_prefixed_object(
2522
- struct packfile_store *store,
2522
+ struct odb_source_packed *store,
2523
const struct odb_for_each_object_options *opts,
2524
- struct packfile_store_for_each_object_wrapper_data *data)
2524
+ struct odb_source_packed_for_each_object_wrapper_data *data)
2525
{
2526
struct packfile_list_entry *e;
2527
struct multi_pack_index *m;
2566
return ret;
2567
}
2568
2569
-int packfile_store_for_each_object(struct packfile_store *store,
2569
+int packfile_store_for_each_object(struct odb_source_packed *store,
2570
const struct object_info *request,
2571
odb_for_each_object_cb cb,
2572
void *cb_data,
2573
const struct odb_for_each_object_options *opts)
2574
{
2575
- struct packfile_store_for_each_object_wrapper_data data = {
2575
+ struct odb_source_packed_for_each_object_wrapper_data data = {
2576
.store = store,
2577
.request = request,
2578
.cb = cb,
2707
*out = len;
2708
}
2709
2710
-int packfile_store_find_abbrev_len(struct packfile_store *store,
2710
+int packfile_store_find_abbrev_len(struct odb_source_packed *store,
2711
const struct object_id *oid,
2712
unsigned min_len,
2713
unsigned *out)
2832
return 0;
2833
}
2834
2835
-struct packfile_store *packfile_store_new(struct odb_source *source)
2835
+struct odb_source_packed *packfile_store_new(struct odb_source *source)
2836
{
2837
- struct packfile_store *store;
2837
+ struct odb_source_packed *store;
2838
CALLOC_ARRAY(store, 1);
2839
store->source = source;
2840
strmap_init(&store->packs_by_path);
2841
return store;
2842
}
2843
2844
-void packfile_store_free(struct packfile_store *store)
2844
+void packfile_store_free(struct odb_source_packed *store)
2845
{
2846
for (struct packfile_list_entry *e = store->packs.head; e; e = e->next)
2847
free(e->pack);
2851
free(store);
2852
}
2853
2854
-void packfile_store_close(struct packfile_store *store)
2854
+void packfile_store_close(struct odb_source_packed *store)
2855
{
2856
for (struct packfile_list_entry *e = store->packs.head; e; e = e->next) {
2857
if (e->pack->do_not_close)
2988
}
2989
2990
int packfile_store_read_object_stream(struct odb_read_stream **out,
2991
- struct packfile_store *store,
2991
+ struct odb_source_packed *store,
2992
const struct object_id *oid)
2993
{
2994
struct pack_entry e;