pub fn initialize_commit_index(
context: &GitContext,
cwd: &Path,
real_index: &Path,
indexes: &CaptureIndexes,
selection: &IndexSelection<'_>,
) -> Result<(), GitFailure>Expand description
What:
Copies or builds the private commit index and snapshots the real index at invocation.
Why:
Index commits start from the real index, so their staged state is the state at invocation;
explicit-path commits start from the recorded base, never live HEAD,
because another landing may have moved it since invocation.
In TS you’d write (pseudocode):
await initializeCommitIndex({ workspace, gitPath, cwd, mode, pathspecs, baseRevision, ... });