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

Function get_remote_bundle_uri

connect.c:517–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517int get_remote_bundle_uri(int fd_out, struct packet_reader *reader,
518 struct bundle_list *bundles, int stateless_rpc)
519{
520 int line_nr = 1;
521
522 /* Assert bundle-uri support */
523 ensure_server_supports_v2("bundle-uri");
524
525 /* (Re-)send capabilities */
526 send_capabilities(fd_out, reader);
527
528 /* Send command */
529 packet_write_fmt(fd_out, "command=bundle-uri\n");
530 packet_delim(fd_out);
531
532 packet_flush(fd_out);
533
534 /* Process response from server */
535 while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
536 const char *line = reader->line;
537 line_nr++;
538
539 if (!bundle_uri_parse_line(bundles, line))
540 continue;
541
542 return error(_("error on bundle-uri response line %d: %s"),
543 line_nr, line);
544 }
545
546 if (reader->status != PACKET_READ_FLUSH)
547 return error(_("expected flush after bundle-uri listing"));
548
549 /*
550 * Might die(), but obscure enough that that's OK, e.g. in
551 * serve.c we'll call BUG() on its equivalent (the
552 * PACKET_READ_RESPONSE_END check).
553 */
554 check_stateless_delimiter(stateless_rpc, reader,
555 _("expected response end packet after ref listing"));
556
557 return 0;
558}
559
560struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
561 struct ref **list, int for_push,

Callers 1

get_bundle_uriFunction · 0.85

Calls 9

send_capabilitiesFunction · 0.85
packet_write_fmtFunction · 0.85
packet_delimFunction · 0.85
packet_flushFunction · 0.85
packet_reader_readFunction · 0.85
bundle_uri_parse_lineFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected