Skip to main content

restore_deleted

Function restore_deleted 

Source
pub fn restore_deleted(
    repo_path: &Path,
    deleted: &[(String, String)],
    global_depth: usize,
    timeout: Duration,
) -> Vec<(String, Result<()>)>
Expand description

Restore exactly the projects a previous pass emptied, and nothing else.

deleted is the (bloat directory label, adapter name) pairs recorded at prune time. restore_project_to_depth would reinstall every project in the tree; a repository where one of five projects was pruned does not want the other four rebuilt, which on a monorepo is the difference between one npm ci and five.

A recorded pair that no longer matches anything in the tree — the project was deleted, renamed, or its manifest removed since the prune — comes back as an Err under its own label rather than being dropped, because a restore that silently skips half its work is the failure mode this whole command exists to avoid.