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

Function add_pack_to_midx

midx-write.c:162–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162static 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
195struct pack_midx_entry {
196 struct object_id oid;

Callers

nothing calls this directly

Calls 8

ends_withFunction · 0.85
display_progressFunction · 0.85
should_include_packFunction · 0.85
add_packed_gitFunction · 0.85
warningFunction · 0.85
open_pack_indexFunction · 0.85
close_packFunction · 0.85
fill_pack_infoFunction · 0.85

Tested by

no test coverage detected