mirror of https://github.com/helix-editor/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
638 B
Rust
33 lines
638 B
Rust
7 months ago
|
use std::path::{Path, PathBuf};
|
||
|
|
||
|
pub enum FileChange {
|
||
|
Untracked {
|
||
|
path: PathBuf,
|
||
|
},
|
||
|
Modified {
|
||
|
path: PathBuf,
|
||
|
},
|
||
|
Conflict {
|
||
|
path: PathBuf,
|
||
|
},
|
||
|
Deleted {
|
||
|
path: PathBuf,
|
||
|
},
|
||
|
Renamed {
|
||
|
from_path: PathBuf,
|
||
|
to_path: PathBuf,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
impl FileChange {
|
||
|
pub fn path(&self) -> &Path {
|
||
|
match self {
|
||
|
Self::Untracked { path } => path,
|
||
|
Self::Modified { path } => path,
|
||
|
Self::Conflict { path } => path,
|
||
|
Self::Deleted { path } => path,
|
||
|
Self::Renamed { to_path, .. } => to_path,
|
||
|
}
|
||
|
}
|
||
|
}
|