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

Function unpack_object_header

packfile.c:1225–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1223}
1224
1225int unpack_object_header(struct packed_git *p,
1226 struct pack_window **w_curs,
1227 off_t *curpos,
1228 size_t *sizep)
1229{
1230 unsigned char *base;
1231 unsigned long left;
1232 unsigned long used;
1233 enum object_type type;
1234
1235 /* use_pack() assures us we have [base, base + 20) available
1236 * as a range that we can look at. (Its actually the hash
1237 * size that is assured.) With our object header encoding
1238 * the maximum deflated object size is 2^137, which is just
1239 * insane, so we know won't exceed what we have been given.
1240 */
1241 base = use_pack(p, w_curs, *curpos, &left);
1242 used = unpack_object_header_buffer(base, left, &type, sizep);
1243 if (!used) {
1244 type = OBJ_BAD;
1245 } else
1246 *curpos += used;
1247
1248 return type;
1249}
1250
1251void mark_bad_packed_object(struct packed_git *p, const struct object_id *oid)
1252{

Callers 8

try_partial_reuseFunction · 0.85
verify_packfileFunction · 0.85
packed_to_object_typeFunction · 0.85
unpack_entryFunction · 0.85
write_reuse_objectFunction · 0.85
write_reused_pack_oneFunction · 0.85

Calls 2

use_packFunction · 0.85

Tested by

no test coverage detected