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

Function parse_pack_index

packfile.c:321–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321struct 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
339static void scan_windows(struct packed_git *p,
340 struct packed_git **lru_p,

Callers 1

Calls 5

pack_path_from_idxFunction · 0.85
st_addFunction · 0.85
alloc_packed_gitFunction · 0.85
hashcpyFunction · 0.85
check_packed_git_idxFunction · 0.85

Tested by

no test coverage detected