Skip to main content

git_idx_for

Function git_idx_for 

Source
pub fn git_idx_for(scratch: &Path, name: &str, pack: &[u8]) -> Result<Vec<u8>>
Expand description

The .idx stock git writes for this pack.

index-pack computes an oid for every entry — deltas resolved — and files it with the offset it found it at. That file is the only independent statement of “what git thinks is in this pack” available without a repository that already has one, so it is the arbiter crate::resolve’s oid guard needs for a pack the test itself built.

Until 2026-08-25 that guard could only find such a pair by scanning ~/git for a repository that happened to have both, which made its corpus the developer’s disk and made it fail outright on a fresh clone. A generated pack has no .idx of its own; this is where one comes from.