| 435 | }; |
| 436 | |
| 437 | static int refs_from_alternate_cb(struct odb_source *alternate, |
| 438 | void *payload) |
| 439 | { |
| 440 | struct strbuf path = STRBUF_INIT; |
| 441 | size_t base_len; |
| 442 | struct alternate_refs_data *cb = payload; |
| 443 | |
| 444 | if (!strbuf_realpath(&path, alternate->path, 0)) |
| 445 | goto out; |
| 446 | if (!strbuf_strip_suffix(&path, "/objects")) |
| 447 | goto out; |
| 448 | base_len = path.len; |
| 449 | |
| 450 | /* Is this a git repository with refs? */ |
| 451 | strbuf_addstr(&path, "/refs"); |
| 452 | if (!is_directory(path.buf)) |
| 453 | goto out; |
| 454 | strbuf_setlen(&path, base_len); |
| 455 | |
| 456 | read_alternate_refs(alternate->odb->repo, path.buf, cb->fn, cb->payload); |
| 457 | |
| 458 | out: |
| 459 | strbuf_release(&path); |
| 460 | return 0; |
| 461 | } |
| 462 | |
| 463 | void odb_for_each_alternate_ref(struct object_database *odb, |
| 464 | odb_for_each_alternate_ref_fn cb, void *payload) |
nothing calls this directly
no test coverage detected