pub enum PathStatus {
Modified,
Added,
Deleted,
Renamed,
Copied,
TypeChanged,
Untracked,
Ignored,
Unmerged(UnmergedKind),
}Expand description
One axis of a path’s change, as git reports it.
Deliberately does NOT include a “clean” or “both staged and
unstaged” value: those are properties of the pair, not of one
axis, and PathChange expresses them (None and Some on both
sides respectively). Encoding them here is what produced the
original bug — a staged modification had to claim to be Added
so the consumer would file it in the right section.
Variants§
Modified
Content changed. On the index axis: staged for commit. On the worktree axis: not yet staged.
Added
Path exists on this side but not the one it is compared against — a new file.
Deleted
Path was removed.
Renamed
Path moved from somewhere else; the origin is
PathChange::original_path. Index axis only — git does not
detect worktree renames.
Copied
Path was copied from somewhere else; origin as for
Self::Renamed. Only produced when rename detection is
configured to find copies (status.renames=copies).
TypeChanged
The path’s TYPE changed — regular file ⇄ symlink ⇄ submodule —
with or without a content change. Git spells this T, and
dropping it (as this parser used to) makes the file vanish from
the status view entirely: a change you can neither see nor
stage.
Untracked
File is not tracked by git. A whole-path state, not an axis.
Ignored
File is ignored via .gitignore. A whole-path state.
Unmerged(UnmergedKind)
File has unmerged entries — a real merge conflict, carrying WHICH of git’s seven combinations it is. A whole-path state: the resolution work is in the worktree, so it is reported there.
Trait Implementations§
Source§impl Clone for PathStatus
impl Clone for PathStatus
Source§fn clone(&self) -> PathStatus
fn clone(&self) -> PathStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PathStatus
Source§impl Debug for PathStatus
impl Debug for PathStatus
impl Eq for PathStatus
Source§impl Hash for PathStatus
impl Hash for PathStatus
Source§impl PartialEq for PathStatus
impl PartialEq for PathStatus
impl StructuralPartialEq for PathStatus
Auto Trait Implementations§
impl Freeze for PathStatus
impl RefUnwindSafe for PathStatus
impl Send for PathStatus
impl Sync for PathStatus
impl Unpin for PathStatus
impl UnsafeUnpin for PathStatus
impl UnwindSafe for PathStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.