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

Function get_bundle_uri

transport.c:402–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402static int get_bundle_uri(struct transport *transport)
403{
404 struct git_transport_data *data = transport->data;
405 struct packet_reader reader;
406 int stateless_rpc = transport->stateless_rpc;
407
408 if (!transport->bundles) {
409 CALLOC_ARRAY(transport->bundles, 1);
410 init_bundle_list(transport->bundles);
411 }
412
413 if (!data->finished_handshake) {
414 struct ref *refs = handshake(transport, 0, NULL, 0);
415
416 if (refs)
417 free_refs(refs);
418 }
419
420 /*
421 * "Support" protocol v0 and v2 without bundle-uri support by
422 * silently degrading to a NOOP.
423 */
424 if (!server_supports_v2("bundle-uri"))
425 return 0;
426
427 packet_reader_init(&reader, data->fd[0], NULL, 0,
428 PACKET_READ_CHOMP_NEWLINE |
429 PACKET_READ_GENTLE_ON_EOF);
430
431 return get_remote_bundle_uri(data->fd[1], &reader,
432 transport->bundles, stateless_rpc);
433}
434
435static int fetch_refs_via_pack(struct transport *transport,
436 int nr_heads, struct ref **to_fetch)

Callers

nothing calls this directly

Calls 6

init_bundle_listFunction · 0.85
handshakeFunction · 0.85
free_refsFunction · 0.85
server_supports_v2Function · 0.85
packet_reader_initFunction · 0.85
get_remote_bundle_uriFunction · 0.85

Tested by

no test coverage detected