| 233 | } |
| 234 | |
| 235 | static 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 | |
| 260 | static int process_dummy_ref(const struct packet_reader *reader) |
| 261 | { |
no test coverage detected