Skip to main content

prepare_native_commit

Function prepare_native_commit 

Source
pub fn prepare_native_commit(
    context: &GitContext,
    cwd: &Path,
    request: &PreparationRequest<'_>,
    journal_directory: &Path,
    intended_tree_oid: &str,
    paths: &PreparedPaths,
) -> Result<PreparedCommit, PreparationError>
Expand description

What: Runs native preparation end to end: native commit, the prepared commit read back, and prepared.json. Why: A failure removes the shadow before it returns, so no shadow outlives a failed preparation, and the exit code of a failed native commit is the invocation’s exit code.

In TS you’d write (pseudocode):

await runNativePreparation(...); const prepared = await readPreparedCommit(...); await writeJournalRecord(...);