use bstr::BString;
use gix_index::entry::stat;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Collision {
pub path: BString,
pub error_kind: std::io::ErrorKind,
}
#[derive(Debug)]
pub struct ErrorRecord {
pub path: BString,
pub error: Box<dyn std::error::Error + Send + Sync + 'static>,
}
#[derive(Debug, Default)]
pub struct Outcome {
pub files_updated: usize,
pub bytes_written: u64,
pub collisions: Vec<Collision>,
pub errors: Vec<ErrorRecord>,
pub delayed_paths_unknown: Vec<BString>,
pub delayed_paths_unprocessed: Vec<BString>,
}
#[derive(Clone, Default)]
pub struct Options {
pub fs: gix_fs::Capabilities,
pub validate: gix_worktree::validate::path::component::Options,
pub thread_limit: Option<usize>,
pub destination_is_initially_empty: bool,
pub overwrite_existing: bool,
pub keep_going: bool,
pub stat_options: stat::Options,
pub attributes: gix_worktree::stack::state::Attributes,
pub filters: gix_filter::Pipeline,
pub filter_process_delay: gix_filter::driver::apply::Delay,
}
#[derive(Debug, thiserror::Error)]
#[allow(missing_docs)]
pub enum Error {
#[error("Could not convert path to UTF8: {}", .path)]
IllformedUtf8 { path: BString },
#[error("The clock was off when reading file related metadata after updating a file on disk")]
Time(#[from] std::time::SystemTimeError),
#[error("IO error while writing blob or reading file metadata or changing filetype")]
Io(#[from] std::io::Error),
#[error("object for checkout at {} could not be retrieved from object database", .path.display())]
Find {
#[source]
err: gix_object::find::existing_object::Error,
path: std::path::PathBuf,
},
#[error(transparent)]
Filter(#[from] gix_filter::pipeline::convert::to_worktree::Error),
#[error(transparent)]
FilterListDelayed(#[from] gix_filter::driver::delayed::list::Error),
#[error(transparent)]
FilterFetchDelayed(#[from] gix_filter::driver::delayed::fetch::Error),
#[error("The entry at path '{rela_path}' was listed as delayed by the filter process, but we never passed it")]
FilterPathUnknown { rela_path: BString },
#[error("The following paths were delayed and apparently forgotten to be processed by the filter driver: ")]
FilterPathsUnprocessed { rela_paths: Vec<BString> },
}
mod chunk;
mod entry;
pub(crate) mod function;