MCPcopy Index your code
hub / github.com/git/git / generated_pack_populate

Function generated_pack_populate

repack.c:340–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338};
339
340struct generated_pack *generated_pack_populate(const char *name,
341 const char *packtmp)
342{
343 struct stat statbuf;
344 struct strbuf path = STRBUF_INIT;
345 struct generated_pack *pack = xcalloc(1, sizeof(*pack));
346 size_t i;
347
348 for (i = 0; i < ARRAY_SIZE(exts); i++) {
349 strbuf_reset(&path);
350 strbuf_addf(&path, "%s-%s%s", packtmp, name, exts[i].name);
351
352 if (stat(path.buf, &statbuf))
353 continue;
354
355 pack->tempfiles[i] = register_tempfile(path.buf);
356 }
357
358 strbuf_release(&path);
359 return pack;
360}
361
362int generated_pack_has_ext(const struct generated_pack *pack, const char *ext)
363{

Callers 2

finish_pack_objects_cmdFunction · 0.85

Calls 5

xcallocFunction · 0.85
strbuf_addfFunction · 0.85
register_tempfileFunction · 0.85
strbuf_releaseFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected