Skip to main content

Module output

Module output 

Source
Expand description

Top-level convenience: encode entries directly to a .pack / .idx file pair.

The pack is first written to a temporary file because its final name contains the checksum, which is not known until encoding completes. A background task drains the encoder’s pack channel while the caller-facing task performs encoding. After the pack is finalized and renamed, a second writer drains the generated index bytes.

Functions§

encode_and_output_to_files
Consume entries and write a matching .pack/.idx pair into output_dir.
encode_and_output_to_files_with_hash_kind
Like encode_and_output_to_files, but for an explicit repository hash_kind (pack checksum, pack-<checksum> file names, ref-delta base IDs and idx object names all follow it). encode_and_output_to_files is the thread-local compatibility wrapper.