| 319 | } |
| 320 | |
| 321 | struct packed_git *parse_pack_index(struct repository *r, unsigned char *sha1, |
| 322 | const char *idx_path) |
| 323 | { |
| 324 | char *path = pack_path_from_idx(idx_path); |
| 325 | size_t alloc = st_add(strlen(path), 1); |
| 326 | struct packed_git *p = alloc_packed_git(r, alloc); |
| 327 | |
| 328 | memcpy(p->pack_name, path, alloc); /* includes NUL */ |
| 329 | free(path); |
| 330 | hashcpy(p->hash, sha1, p->repo->hash_algo); |
| 331 | if (check_packed_git_idx(idx_path, p)) { |
| 332 | free(p); |
| 333 | return NULL; |
| 334 | } |
| 335 | |
| 336 | return p; |
| 337 | } |
| 338 | |
| 339 | static void scan_windows(struct packed_git *p, |
| 340 | struct packed_git **lru_p, |
no test coverage detected