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

Function show_text_ref

http-backend.c:521–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521static int show_text_ref(const struct reference *ref, void *cb_data)
522{
523 const char *name_nons = strip_namespace(ref->name);
524 struct strbuf *buf = cb_data;
525 struct object *o = parse_object(the_repository, ref->oid);
526 if (!o)
527 return 0;
528
529 strbuf_addf(buf, "%s\t%s\n", oid_to_hex(ref->oid), name_nons);
530 if (o->type == OBJ_TAG) {
531 o = deref_tag(the_repository, o, ref->name, 0);
532 if (!o)
533 return 0;
534 strbuf_addf(buf, "%s\t%s^{}\n", oid_to_hex(&o->oid),
535 name_nons);
536 }
537 return 0;
538}
539
540static void get_info_refs(struct strbuf *hdr, char *arg UNUSED)
541{

Callers

nothing calls this directly

Calls 5

strip_namespaceFunction · 0.85
parse_objectFunction · 0.85
strbuf_addfFunction · 0.85
oid_to_hexFunction · 0.85
deref_tagFunction · 0.85

Tested by

no test coverage detected