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

Function server_supports_hash

connect.c:661–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661int server_supports_hash(const char *desired, int *feature_supported)
662{
663 size_t offset = 0;
664 size_t len;
665 const char *hash;
666
667 hash = next_server_feature_value("object-format", &len, &offset);
668 if (feature_supported)
669 *feature_supported = !!hash;
670 if (!hash) {
671 hash = hash_algos[GIT_HASH_SHA1_LEGACY].name;
672 len = strlen(hash);
673 }
674 while (hash) {
675 if (!xstrncmpz(desired, hash, len))
676 return 1;
677
678 hash = next_server_feature_value("object-format", &len, &offset);
679 }
680 return 0;
681}
682
683int parse_feature_request(const char *feature_list, const char *feature)
684{

Callers 2

do_fetch_packFunction · 0.85
send_packFunction · 0.85

Calls 2

xstrncmpzFunction · 0.85

Tested by

no test coverage detected