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

Function process_ref

connect.c:283–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283static int process_ref(const struct packet_reader *reader, size_t len,
284 struct ref ***list, unsigned int flags,
285 struct oid_array *extra_have)
286{
287 const char *line = reader->line;
288 struct object_id old_oid;
289 const char *name;
290
291 if (parse_oid_hex_algop(line, &old_oid, &name, reader->hash_algo))
292 return 0;
293 if (*name != ' ')
294 return 0;
295 name++;
296
297 if (extra_have && !strcmp(name, ".have")) {
298 oid_array_append(extra_have, &old_oid);
299 } else if (!strcmp(name, "capabilities^{}")) {
300 die(_("protocol error: unexpected capabilities^{}"));
301 } else if (check_ref(name, flags)) {
302 struct ref *ref = alloc_ref(name);
303 oidcpy(&ref->old_oid, &old_oid);
304 **list = ref;
305 *list = &ref->next;
306 }
307 check_no_capabilities(line, len);
308 return 1;
309}
310
311static int process_shallow(const struct packet_reader *reader, size_t len,
312 struct oid_array *shallow_points)

Callers 1

get_remote_headsFunction · 0.85

Calls 6

oid_array_appendFunction · 0.85
alloc_refFunction · 0.85
oidcpyFunction · 0.85
check_no_capabilitiesFunction · 0.85
dieFunction · 0.70
check_refFunction · 0.70

Tested by

no test coverage detected