| 1649 | } |
| 1650 | |
| 1651 | static 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 | |
| 1674 | static void receive_packfile_uris(struct packet_reader *reader, |
| 1675 | struct string_list *uris) |
no test coverage detected