use std::path::PathBuf;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum BackendKind {
Git,
Jj,
}
impl BackendKind {
pub fn as_str(self) -> &'static str {
match self {
BackendKind::Git => "git",
BackendKind::Jj => "jj",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum ChangeKind {
Added,
Modified,
Deleted,
Renamed,
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct FileChange {
pub path: String,
pub old_path: Option<String>,
pub kind: ChangeKind,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[non_exhaustive]
pub struct DiffStat {
pub files_changed: usize,
pub insertions: usize,
pub deletions: usize,
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct WorktreeInfo {
pub path: PathBuf,
pub branch: Option<String>,
pub commit: Option<String>,
pub is_bare: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum CreateOutcome {
Plain,
CowCloned,
}