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

Function get_ack

fetch-pack.c:225–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225static enum ack_type get_ack(struct packet_reader *reader,
226 struct object_id *result_oid)
227{
228 int len;
229 const char *arg;
230
231 if (packet_reader_read(reader) != PACKET_READ_NORMAL)
232 die(_("git fetch-pack: expected ACK/NAK, got a flush packet"));
233 len = reader->pktlen;
234
235 if (!strcmp(reader->line, "NAK"))
236 return NAK;
237 if (skip_prefix(reader->line, "ACK ", &arg)) {
238 const char *p;
239 if (!parse_oid_hex(arg, result_oid, &p)) {
240 len -= p - reader->line;
241 if (len < 1)
242 return ACK;
243 if (strstr(p, "continue"))
244 return ACK_continue;
245 if (strstr(p, "common"))
246 return ACK_common;
247 if (strstr(p, "ready"))
248 return ACK_ready;
249 return ACK;
250 }
251 }
252 die(_("git fetch-pack: expected ACK/NAK, got '%s'"), reader->line);
253}
254
255static void send_request(struct fetch_pack_args *args,
256 int fd, struct strbuf *buf)

Callers 1

find_commonFunction · 0.85

Calls 3

packet_reader_readFunction · 0.85
parse_oid_hexFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected