liboxen 0.53.0

Oxen is a fast data version control system, built with machine learning training data in mind. Designed to handle terabytes of data with ease, using a workflow similar to git. Version both structured and unstructured data of any modality: text, images, video, audio, CSV, Parquet, JSONL, model checkpoints, and more. liboxen is the embeddable core library behind the oxen CLI and server, which power fine tuning and inference pipelines for multimodal LLMs, image models, and video models on Oxen.ai.
use crate::core::v_latest::index;
use crate::error::OxenError;
use crate::model::LocalRepository;
use crate::opts::{GlobOpts, RestoreOpts};
use crate::util;

// TODO: Deprecate this module
// Not sure why we have seperate core and core::index modules for restore
pub async fn restore(repo: &LocalRepository, restore_opts: RestoreOpts) -> Result<(), OxenError> {
    let paths = restore_opts.paths.iter().map(|p| p.to_owned()).collect();

    let glob_opts = GlobOpts {
        paths,
        staged_db: restore_opts.staged,
        merkle_tree: !restore_opts.staged,
        working_dir: false,
        walk_dirs: false,
    };

    let expanded_paths = util::glob::parse_glob_paths(&glob_opts, Some(repo)).await?;

    let mut restore_opts = restore_opts.clone();
    restore_opts.paths = expanded_paths;

    index::restore::restore(repo, restore_opts).await?;

    Ok(())
}