class documentation

Container for objects packed in a pack file.

Method get_unpacked_object Get a raw unresolved object.
Method iter_unpacked_subset Iterate over unpacked objects from a subset of SHAs.
Method iterobjects_subset Iterate over a subset of objects.

Inherited from ObjectContainer:

Method __contains__ Check if a hex sha is present.
Method __getitem__ Retrieve an object.
Method add_object Add a single object to this object store.
Method add_objects Add a set of objects to this object store.
Method get_commit_graph Get the commit graph for this object store.
def get_unpacked_object(self, sha1: ObjectID | RawObjectID, *, include_comp: bool = False) -> UnpackedObject:

Get a raw unresolved object.

Parameters
sha1:ObjectID | RawObjectIDSHA-1 hash of the object
include_comp:boolWhether to include compressed data
Returns
UnpackedObjectUnpackedObject instance
def iter_unpacked_subset(self, shas: Iterable[ObjectID | RawObjectID], *, include_comp: bool = False, allow_missing: bool = False, convert_ofs_delta: bool = True) -> Iterator[UnpackedObject]:

Iterate over unpacked objects from a subset of SHAs.

Parameters
shas:Iterable[ObjectID | RawObjectID]Set of object SHAs to retrieve
include_comp:boolInclude compressed data if True
allow_missing:boolIf True, skip missing objects
convert_ofs_delta:boolIf True, convert offset deltas to ref deltas
Returns
Iterator[UnpackedObject]Iterator of UnpackedObject instances
def iterobjects_subset(self, shas: Iterable[ObjectID], *, allow_missing: bool = False) -> Iterator[ShaFile]:

Iterate over a subset of objects.

Parameters
shas:Iterable[ObjectID]Iterable of object SHAs to retrieve
allow_missing:boolIf True, skip missing objects
Returns
Iterator[ShaFile]Iterator of ShaFile objects