Skip to main content

assert_final_source_equivalence

Function assert_final_source_equivalence 

Source
pub fn assert_final_source_equivalence(
    source_root: &Path,
    stage_root: &Path,
    selected_roots: &[String],
    excluded_source_roots: &[PathBuf],
    staged_entries: &[WorktreeCopyEntry],
) -> Result<(), WorktreeCopyError>
Expand description

What: Checks that the source still matches the initial manifest after staging, and that the stage holds exactly that manifest. Why: Any difference means the source changed during the copy, so the destination must not receive the stage.

In TS you’d write (pseudocode):

await assertFinalSourceEquivalence({ sourceRoot, stageRoot, selectedRoots, excludedSourceRoots, stagedEntries });