| 870 | } |
| 871 | |
| 872 | struct 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 | |
| 898 | void (*report_garbage)(unsigned seen_bits, const char *path); |
| 899 |
no test coverage detected