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

Function process_capabilities

connect.c:235–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235static void process_capabilities(struct packet_reader *reader, size_t *linelen)
236{
237 const char *feat_val;
238 size_t feat_len;
239 const char *line = reader->line;
240 size_t nul_location = strlen(line);
241 if (nul_location == *linelen)
242 return;
243
244 free(server_capabilities_v1);
245 server_capabilities_v1 = xstrdup(line + nul_location + 1);
246 *linelen = nul_location;
247
248 feat_val = server_feature_value("object-format", &feat_len);
249 if (feat_val) {
250 char *hash_name = xstrndup(feat_val, feat_len);
251 int hash_algo = hash_algo_by_name(hash_name);
252 if (hash_algo != GIT_HASH_UNKNOWN)
253 reader->hash_algo = &hash_algos[hash_algo];
254 free(hash_name);
255 } else {
256 reader->hash_algo = &hash_algos[GIT_HASH_SHA1_LEGACY];
257 }
258}
259
260static int process_dummy_ref(const struct packet_reader *reader)
261{

Callers 1

get_remote_headsFunction · 0.85

Calls 4

xstrdupFunction · 0.85
server_feature_valueFunction · 0.85
xstrndupFunction · 0.85
hash_algo_by_nameFunction · 0.85

Tested by

no test coverage detected