use crate::core::repo_locks;
use crate::core::v_latest::prune::{
PruneStats, prune as prune_impl, prune_remote as prune_remote_impl,
};
use crate::error::OxenError;
use crate::model::{LocalRepository, RemoteRepository};
pub async fn prune(repo: &LocalRepository, dry_run: bool) -> Result<PruneStats, OxenError> {
let work = prune_impl(repo, dry_run);
if dry_run {
work.await
} else {
repo_locks::with_repo_exclusive(repo, work).await
}
}
pub async fn prune_remote(
remote_repo: &RemoteRepository,
dry_run: bool,
) -> Result<PruneStats, OxenError> {
prune_remote_impl(remote_repo, dry_run).await
}