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

Function cap_object_info

protocol-caps.c:80–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80int 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}

Callers

nothing calls this directly

Calls 8

packet_writer_initFunction · 0.85
packet_reader_readFunction · 0.85
parse_oidFunction · 0.85
packet_writer_errorFunction · 0.85
send_infoFunction · 0.85
string_list_clearFunction · 0.85
packet_flushFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected