MCPcopy Create free account
hub / github.com/git/git / packfile_store_for_each_prefixed_object

Function packfile_store_for_each_prefixed_object

packfile.c:2507–2553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2505}
2506
2507static int packfile_store_for_each_prefixed_object(
2508 struct packfile_store *store,
2509 const struct odb_for_each_object_options *opts,
2510 struct packfile_store_for_each_object_wrapper_data *data)
2511{
2512 struct packfile_list_entry *e;
2513 struct multi_pack_index *m;
2514 bool pack_errors = false;
2515 int ret;
2516
2517 if (opts->flags)
2518 BUG("flags unsupported");
2519
2520 store->skip_mru_updates = true;
2521
2522 m = get_multi_pack_index(store->source);
2523 if (m) {
2524 ret = for_each_prefixed_object_in_midx(store, m, opts, data);
2525 if (ret)
2526 goto out;
2527 }
2528
2529 for (e = packfile_store_get_packs(store); e; e = e->next) {
2530 if (e->pack->multi_pack_index)
2531 continue;
2532
2533 if (open_pack_index(e->pack)) {
2534 pack_errors = true;
2535 continue;
2536 }
2537
2538 if (!e->pack->num_objects)
2539 continue;
2540
2541 ret = for_each_prefixed_object_in_pack(store, e->pack, opts, data);
2542 if (ret)
2543 goto out;
2544 }
2545
2546 ret = 0;
2547
2548out:
2549 store->skip_mru_updates = false;
2550 if (!ret && pack_errors)
2551 ret = -1;
2552 return ret;
2553}
2554
2555int packfile_store_for_each_object(struct packfile_store *store,
2556 const struct object_info *request,

Callers 1

Calls 5

get_multi_pack_indexFunction · 0.85
packfile_store_get_packsFunction · 0.85
open_pack_indexFunction · 0.85

Tested by

no test coverage detected