Skip to main content

install_prepared

Function install_prepared 

Source
pub fn install_prepared(
    replacements: &[Replacement],
    real_index: &Path,
    index_before: &Option<Vec<u8>>,
) -> Result<(), String>
Expand description

What: Rename every prepared file over its destination, then prove the real index still holds index_before. &Option<Vec<u8>> borrows the bytes read before, or absence. Why: The fix changes the worktree only. A rename that fails, an index that changed, or an index that cannot be read restores every file already replaced.

In TS you’d write (pseudocode):

async function installPrepared(replacements, realIndexPath, indexBefore): Promise<void>;