git.packed_entry

git

packed_entry(git_dir, sha_hex) -> entry

Read a packed object's entry as its pack stores it

Returns { type = t, size = n, stream = bytes, pack = pack_path }, with the entry's zlib stream as it lies in the pack, inflated nothing. type is "commit", "tree", "blob", "tag" or "delta". size is the header's: the object's size, or the delta's own inflated size.

A delta adds base, its base's id. An OFS_DELTA's base offset is turned into its id through the idx.

Returns nil when no pack holds the object, even when a loose copy exists. A packed copy wins here, where a loose copy wins in read_object: both copies hold the same object.