| 78 | } |
| 79 | |
| 80 | int cap_object_info(struct repository *r, struct packet_reader *request) |
| 81 | { |
| 82 | struct requested_info info = { 0 }; |
| 83 | struct packet_writer writer; |
| 84 | struct string_list oid_str_list = STRING_LIST_INIT_DUP; |
| 85 | |
| 86 | packet_writer_init(&writer, 1); |
| 87 | |
| 88 | while (packet_reader_read(request) == PACKET_READ_NORMAL) { |
| 89 | if (!strcmp("size", request->line)) { |
| 90 | info.size = 1; |
| 91 | continue; |
| 92 | } |
| 93 | |
| 94 | if (parse_oid(request->line, &oid_str_list)) |
| 95 | continue; |
| 96 | |
| 97 | packet_writer_error(&writer, |
| 98 | "object-info: unexpected line: '%s'", |
| 99 | request->line); |
| 100 | } |
| 101 | |
| 102 | if (request->status != PACKET_READ_FLUSH) { |
| 103 | packet_writer_error( |
| 104 | &writer, "object-info: expected flush after arguments"); |
| 105 | die(_("object-info: expected flush after arguments")); |
| 106 | } |
| 107 | |
| 108 | send_info(r, &writer, &oid_str_list, &info); |
| 109 | |
| 110 | string_list_clear(&oid_str_list, 1); |
| 111 | |
| 112 | packet_flush(1); |
| 113 | |
| 114 | return 0; |
| 115 | } |
nothing calls this directly
no test coverage detected