class documentation

Class encapsulating an object unpacked from a pack file.

These objects should only be created from within unpack_object. Most members start out as empty and are filled in at various points by read_zlib_chunks, unpack_object, DeltaChainIterator, etc.

End users of this object should take care that the function they're getting this object from is guaranteed to set the members they need.

Method __eq__ Check equality with another UnpackedObject.
Method __init__ Initialize an UnpackedObject.
Method __ne__ Check inequality with another UnpackedObject.
Method __repr__ Return string representation of this UnpackedObject.
Method sha Return the binary SHA of this object.
Method sha_file Return a ShaFile from this object.
Class Variable __slots__ Undocumented
Instance Variable comp_chunks Undocumented
Instance Variable crc32 Undocumented
Instance Variable decomp_chunks Undocumented
Instance Variable decomp_len Undocumented
Instance Variable delta_base Undocumented
Instance Variable hash_func Undocumented
Instance Variable obj_chunks Undocumented
Instance Variable obj_type_num Undocumented
Instance Variable offset Undocumented
Instance Variable pack_type_num Undocumented
Method _obj Return the decompressed chunks, or (delta base, delta chunks).
Instance Variable _sha Undocumented
def __eq__(self, other: object) -> bool:

Check equality with another UnpackedObject.

def __init__(self, pack_type_num: int, *, delta_base: None | bytes | int = None, decomp_len: int | None = None, crc32: int | None = None, sha: bytes | None = None, decomp_chunks: list[bytes] | None = None, offset: int | None = None, hash_func: Callable[[], HashObject] = sha1):

Initialize an UnpackedObject.

Parameters
pack_type_num:intType number of this object in the pack
delta_base:None | bytes | intDelta base (offset or SHA) if this is a delta object
decomp_len:int | NoneDecompressed length of this object
crc32:int | NoneCRC32 checksum
sha:bytes | NoneSHA hash of the object
decomp_chunks:list[bytes] | NoneDecompressed chunks
offset:int | NoneOffset in the pack file
hash_func:Callable[[], HashObject]Hash function to use (defaults to sha1)
def __ne__(self, other: object) -> bool:

Check inequality with another UnpackedObject.

def __repr__(self) -> str:

Return string representation of this UnpackedObject.

def sha(self) -> RawObjectID:

Return the binary SHA of this object.

def sha_file(self) -> ShaFile:

Return a ShaFile from this object.

__slots__: list[str] =

Undocumented

comp_chunks: list[bytes] | None =

Undocumented

crc32: int | None =

Undocumented

decomp_chunks: list[bytes] =

Undocumented

decomp_len: int | None =

Undocumented

delta_base: None | bytes | int =

Undocumented

hash_func: Callable[[], HashObject] =

Undocumented

obj_chunks: list[bytes] | None =

Undocumented

obj_type_num: int | None =

Undocumented

offset: int | None =

Undocumented

pack_type_num: int =

Undocumented

def _obj(self) -> OldUnpackedObject:

Return the decompressed chunks, or (delta base, delta chunks).

_sha: bytes | None =

Undocumented