| 338 | }; |
| 339 | |
| 340 | struct 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 | |
| 362 | int generated_pack_has_ext(const struct generated_pack *pack, const char *ext) |
| 363 | { |
no test coverage detected