| 160 | } |
| 161 | |
| 162 | static void add_pack_to_midx(const char *full_path, size_t full_path_len, |
| 163 | const char *file_name, void *data) |
| 164 | { |
| 165 | struct write_midx_context *ctx = data; |
| 166 | struct packed_git *p; |
| 167 | |
| 168 | if (ends_with(file_name, ".idx")) { |
| 169 | display_progress(ctx->progress, ++ctx->pack_paths_checked); |
| 170 | |
| 171 | if (!should_include_pack(ctx, file_name)) |
| 172 | return; |
| 173 | |
| 174 | ALLOC_GROW(ctx->info, ctx->nr + 1, ctx->alloc); |
| 175 | p = add_packed_git(ctx->repo, full_path, full_path_len, 0); |
| 176 | if (!p) { |
| 177 | warning(_("failed to add packfile '%s'"), |
| 178 | full_path); |
| 179 | return; |
| 180 | } |
| 181 | |
| 182 | if (open_pack_index(p)) { |
| 183 | warning(_("failed to open pack-index '%s'"), |
| 184 | full_path); |
| 185 | close_pack(p); |
| 186 | free(p); |
| 187 | return; |
| 188 | } |
| 189 | |
| 190 | fill_pack_info(&ctx->info[ctx->nr], p, file_name, ctx->nr); |
| 191 | ctx->nr++; |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | struct pack_midx_entry { |
| 196 | struct object_id oid; |
nothing calls this directly
no test coverage detected