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

Function receive_wanted_refs

fetch-pack.c:1651–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1649}
1650
1651static void receive_wanted_refs(struct packet_reader *reader,
1652 struct ref **sought, int nr_sought)
1653{
1654 process_section_header(reader, "wanted-refs", 0);
1655 while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
1656 struct object_id oid;
1657 const char *end;
1658 struct ref **found;
1659
1660 if (parse_oid_hex(reader->line, &oid, &end) || *end++ != ' ')
1661 die(_("expected wanted-ref, got '%s'"), reader->line);
1662
1663 found = bsearch(end, sought, nr_sought, sizeof(*sought),
1664 cmp_name_ref);
1665 if (!found)
1666 die(_("unexpected wanted-ref: '%s'"), reader->line);
1667 oidcpy(&(*found)->old_oid, &oid);
1668 }
1669
1670 if (reader->status != PACKET_READ_DELIM)
1671 die(_("error processing wanted refs: %d"), reader->status);
1672}
1673
1674static void receive_packfile_uris(struct packet_reader *reader,
1675 struct string_list *uris)

Callers 1

do_fetch_pack_v2Function · 0.85

Calls 5

process_section_headerFunction · 0.85
packet_reader_readFunction · 0.85
parse_oid_hexFunction · 0.85
oidcpyFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected