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

Function packfile_store_load_pack

packfile.c:872–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872struct packed_git *packfile_store_load_pack(struct packfile_store *store,
873 const char *idx_path, int local)
874{
875 struct strbuf key = STRBUF_INIT;
876 struct packed_git *p;
877
878 /*
879 * We're being called with the path to the index file, but `pack_map`
880 * holds the path to the packfile itself.
881 */
882 strbuf_addstr(&key, idx_path);
883 strbuf_strip_suffix(&key, ".idx");
884 strbuf_addstr(&key, ".pack");
885
886 p = strmap_get(&store->packs_by_path, key.buf);
887 if (!p) {
888 p = add_packed_git(store->source->odb->repo, idx_path,
889 strlen(idx_path), local);
890 if (p)
891 packfile_store_add_pack(store, p);
892 }
893
894 strbuf_release(&key);
895 return p;
896}
897
898void (*report_garbage)(unsigned seen_bits, const char *path);
899

Callers 4

prepare_packFunction · 0.85
prepare_midx_packFunction · 0.85
finalFunction · 0.85
end_packfileFunction · 0.85

Calls 6

strbuf_addstrFunction · 0.85
strbuf_strip_suffixFunction · 0.85
strmap_getFunction · 0.85
add_packed_gitFunction · 0.85
packfile_store_add_packFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected