pub fn write_index(
entries: &[IndexEntry],
pack_checksum: ObjectId,
output: &mut impl Write,
) -> Result<ObjectId, Error>Expand description
Stream a Git version-2 index for already verified pack metadata. Supports SHA-1/SHA-256, empty packs and 64-bit offsets. The caller supplies entries in strictly increasing ID order and the corresponding complete pack checksum. Malformed metadata fails before output; sink failures invalidate partial output. This validates metadata shape, not pack bytes or object bodies. The returned index checksum is also written as its trailer.