class documentation

Writer for reftable files.

Method __init__ Initialize ReftableWriter.
Method add_ref Add a direct reference.
Method add_symbolic_ref Add a symbolic reference.
Method delete_ref Mark a reference as deleted.
Method write Write the reftable to the file.
Instance Variable auto_create_head Undocumented
Instance Variable f Undocumented
Instance Variable header_data Undocumented
Instance Variable is_batch_operation Undocumented
Instance Variable max_update_index Undocumented
Instance Variable min_update_index Undocumented
Instance Variable refs Undocumented
Instance Variable refs_order Undocumented
Method _get_ref_update_indices Get update indices for all refs based on operation type.
Method _maybe_auto_create_head Auto-create HEAD -> refs/heads/master if needed (Git compatibility).
Method _write_final_padding Write final padding and CRC for Git compatibility.
Method _write_header Write the reftable header.
Method _write_ref_blocks Write reference blocks.
Instance Variable _written_data Undocumented
def __init__(self, f: BinaryIO, auto_create_head: bool = True, is_batch_operation: bool = False):

Initialize ReftableWriter.

Parameters
f:BinaryIOBinary file object to write to
auto_create_head:boolWhether to automatically create HEAD reference
is_batch_operation:boolWhether this is a batch operation
def add_ref(self, refname: bytes, sha: bytes):

Add a direct reference.

def add_symbolic_ref(self, refname: bytes, target: bytes):

Add a symbolic reference.

def delete_ref(self, refname: bytes):

Mark a reference as deleted.

def write(self):

Write the reftable to the file.

auto_create_head =

Undocumented

f =

Undocumented

header_data =

Undocumented

is_batch_operation =

Undocumented

max_update_index =

Undocumented

min_update_index: int =

Undocumented

Undocumented

refs_order: list[bytes] =

Undocumented

def _get_ref_update_indices(self) -> dict[bytes, int]:

Get update indices for all refs based on operation type.

In batch operations, all refs get the same update index (timestamp). In non-batch operations, refs are assigned sequential indices starting from min_update_index.

Returns
dict[bytes, int]Mapping of ref names to their update indices
def _maybe_auto_create_head(self):

Auto-create HEAD -> refs/heads/master if needed (Git compatibility).

def _write_final_padding(self):

Write final padding and CRC for Git compatibility.

def _write_header(self):

Write the reftable header.

def _write_ref_blocks(self):

Write reference blocks.

_written_data: list[bytes] =

Undocumented