MCPcopy Create free account
hub / github.com/git/git / add_info_ref

Function add_info_ref

server-info.c:151–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151static int add_info_ref(const struct reference *ref, void *cb_data)
152{
153 struct update_info_ctx *uic = cb_data;
154 struct object *o = parse_object(uic->repo, ref->oid);
155 if (!o)
156 return -1;
157
158 if (uic_printf(uic, "%s %s\n", oid_to_hex(ref->oid), ref->name) < 0)
159 return -1;
160
161 if (o->type == OBJ_TAG) {
162 o = deref_tag(uic->repo, o, ref->name, 0);
163 if (o)
164 if (uic_printf(uic, "%s %s^{}\n",
165 oid_to_hex(&o->oid), ref->name) < 0)
166 return -1;
167 }
168 return 0;
169}
170
171static int generate_info_refs(struct update_info_ctx *uic)
172{

Callers

nothing calls this directly

Calls 4

parse_objectFunction · 0.85
uic_printfFunction · 0.85
oid_to_hexFunction · 0.85
deref_tagFunction · 0.85

Tested by

no test coverage detected