| 578 | } |
| 579 | |
| 580 | static int show_head_ref(const struct reference *ref, void *cb_data) |
| 581 | { |
| 582 | struct strbuf *buf = cb_data; |
| 583 | |
| 584 | if (ref->flags & REF_ISSYMREF) { |
| 585 | const char *target = refs_resolve_ref_unsafe(get_main_ref_store(the_repository), |
| 586 | ref->name, |
| 587 | RESOLVE_REF_READING, |
| 588 | NULL, NULL); |
| 589 | |
| 590 | if (target) |
| 591 | strbuf_addf(buf, "ref: %s\n", strip_namespace(target)); |
| 592 | } else { |
| 593 | strbuf_addf(buf, "%s\n", oid_to_hex(ref->oid)); |
| 594 | } |
| 595 | |
| 596 | return 0; |
| 597 | } |
| 598 | |
| 599 | static void get_head(struct strbuf *hdr, char *arg UNUSED) |
| 600 | { |
nothing calls this directly
no test coverage detected