class documentation

Version 2 Pack Index file.

Method __init__ Initialize a version 2 pack index.
Method calculate_checksum Calculate the checksum over this pack index.
Method get_pack_checksum Return the checksum stored for the corresponding packfile.
Method get_stored_checksum Return the checksum stored for this index.
Instance Variable hash_size Undocumented
Instance Variable object_format Undocumented
Instance Variable version Undocumented
Method _unpack_crc32_checksum Unpack the crc32 checksum for the ith object from the index file.
Method _unpack_entry Unpack the i-th entry in the index file.
Method _unpack_name Unpack the i-th name from the index file.
Method _unpack_offset Unpack the i-th object offset from the index file.
Instance Variable _crc32_table_offset Undocumented
Instance Variable _fan_out_table Undocumented
Instance Variable _name_table_offset Undocumented
Instance Variable _pack_offset_largetable_offset Undocumented
Instance Variable _pack_offset_table_offset Undocumented

Inherited from FilePackIndex:

Method __eq__ Check equality with another FilePackIndex.
Method __len__ Return the number of entries in this pack index.
Method check Check that the stored checksum matches the actual checksum.
Method close Close the underlying file and any mmap.
Method iter_prefix Iterate over all SHA1s with the given prefix.
Method iterentries Iterate over the entries in this pack index.
Method object_offset Return the offset in to the corresponding packfile for the object.
Property path Return the path to this index file.
Method _itersha Iterate over all SHA1s in the index.
Method _object_offset See object_offset.
Method _read_fan_out_table Read the fan-out table from the index.
Instance Variable _contents Undocumented
Instance Variable _file Undocumented
Instance Variable _filename Undocumented
Instance Variable _size Undocumented

Inherited from PackIndex (via FilePackIndex):

Method __iter__ Iterate over the SHAs in this pack.
Method __ne__ Check if this pack index is not equal to another.
Method object_sha1 Return the SHA1 corresponding to the index in the pack file.
Method objects_sha1 Return the hex SHA1 over all the shas of all objects in this pack.
def __init__(self, filename: str | os.PathLike[str], object_format: ObjectFormat, file: IO[bytes] | _GitFile | None = None, contents: bytes | None = None, size: int | None = None):

Initialize a version 2 pack index.

Parameters
filename:str | os.PathLike[str]Path to the index file
object_format:ObjectFormatObject format used by the repository
file:IO[bytes] | _GitFile | NoneOptional file object
contents:bytes | NoneOptional mmap'd contents
size:int | NoneOptional size of the index
def calculate_checksum(self) -> bytes:

Calculate the checksum over this pack index.

Returns: binary digest (size depends on hash algorithm)

def get_pack_checksum(self) -> bytes:

Return the checksum stored for the corresponding packfile.

Returns: binary digest (size depends on hash algorithm)

def get_stored_checksum(self) -> bytes:

Return the checksum stored for this index.

Returns: binary digest (size depends on hash algorithm)

hash_size =

Undocumented

object_format =

Undocumented

version =

Undocumented

def _unpack_crc32_checksum(self, i: int) -> int:

Unpack the crc32 checksum for the ith object from the index file.

def _unpack_entry(self, i: int) -> tuple[RawObjectID, int, int]:

Unpack the i-th entry in the index file.

Returns: Tuple with object name (SHA), offset in pack file and CRC32
checksum (if known).
def _unpack_name(self, i: int) -> bytes:

Unpack the i-th name from the index file.

def _unpack_offset(self, i: int) -> int:

Unpack the i-th object offset from the index file.

_crc32_table_offset =

Undocumented

_fan_out_table =
_name_table_offset =

Undocumented

_pack_offset_largetable_offset =

Undocumented

_pack_offset_table_offset =

Undocumented