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

Function is_pack_valid

packfile.c:2100–2119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2098}
2099
2100int is_pack_valid(struct packed_git *p)
2101{
2102 /* An already open pack is known to be valid. */
2103 if (p->pack_fd != -1)
2104 return 1;
2105
2106 /* If the pack has one window completely covering the
2107 * file size, the pack is known to be valid even if
2108 * the descriptor is not currently open.
2109 */
2110 if (p->windows) {
2111 struct pack_window *w = p->windows;
2112
2113 if (!w->offset && w->len == p->pack_size)
2114 return 1;
2115 }
2116
2117 /* Force the pack to open to prove its valid. */
2118 return !open_packed_git(p);
2119}
2120
2121static int fill_pack_entry(const struct object_id *oid,
2122 struct pack_entry *e,

Callers 8

open_pack_bitmap_1Function · 0.85
verify_packfileFunction · 0.85
fill_pack_entryFunction · 0.85
fill_midx_entryFunction · 0.85
want_found_objectFunction · 0.85
want_object_in_pack_oneFunction · 0.85
stdin_packs_read_inputFunction · 0.85

Calls 1

open_packed_gitFunction · 0.85

Tested by

no test coverage detected