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

Function send_capabilities

connect.c:490–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490static void send_capabilities(int fd_out, struct packet_reader *reader)
491{
492 const char *hash_name;
493 const char *promisor_remote_info;
494
495 if (server_supports_v2("agent"))
496 packet_write_fmt(fd_out, "agent=%s", git_user_agent_sanitized());
497
498 if (server_feature_v2("object-format", &hash_name)) {
499 int hash_algo = hash_algo_by_name(hash_name);
500 if (hash_algo == GIT_HASH_UNKNOWN)
501 die(_("unknown object format '%s' specified by server"), hash_name);
502 reader->hash_algo = &hash_algos[hash_algo];
503 packet_write_fmt(fd_out, "object-format=%s", reader->hash_algo->name);
504 } else {
505 reader->hash_algo = &hash_algos[GIT_HASH_SHA1_LEGACY];
506 }
507 if (server_feature_v2("promisor-remote", &promisor_remote_info)) {
508 char *reply;
509 promisor_remote_reply(promisor_remote_info, &reply);
510 if (reply) {
511 packet_write_fmt(fd_out, "promisor-remote=%s", reply);
512 free(reply);
513 }
514 }
515}
516
517int get_remote_bundle_uri(int fd_out, struct packet_reader *reader,
518 struct bundle_list *bundles, int stateless_rpc)

Callers 2

get_remote_bundle_uriFunction · 0.85
get_remote_refsFunction · 0.85

Calls 7

server_supports_v2Function · 0.85
packet_write_fmtFunction · 0.85
git_user_agent_sanitizedFunction · 0.85
server_feature_v2Function · 0.85
hash_algo_by_nameFunction · 0.85
promisor_remote_replyFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected