Function restore_snapshot

Source
pub fn restore_snapshot(
    effects: &Effects,
    git_run_info: &GitRunInfo,
    repo: &Repo,
    event_tx_id: EventTransactionId,
    snapshot: &WorkingCopySnapshot<'_>,
) -> EyreExitOr<()>
Expand description

Restore the given snapshot’s contents into the working copy.

All tracked working copy contents are discarded, so the caller should take a snapshot of them first, or otherwise ensure that the user’s work is not lost.

If there are untracked changes in the working copy, they are left intact, unless they would conflict with the working copy snapshot contents. In that case, the operation is aborted.