pub enum WorkingDirState {
Clean,
HasUnstagedChanges,
HasStagedChanges,
HasMixedChanges,
HasUntrackedFiles,
}Expand description
State of the working directory
Variants§
Clean
No uncommitted changes and no untracked files
HasUnstagedChanges
Has unstaged changes only
HasStagedChanges
Has staged changes only
HasMixedChanges
Has both staged and unstaged changes
HasUntrackedFiles
Has untracked files only (no staged or unstaged tracked changes)
Implementations§
Source§impl WorkingDirState
impl WorkingDirState
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Detect the current working directory state
Untracked files count as “not clean”: leaving them out caused gw pause
to skip the WIP commit (and switch home) when the only work was new,
unstaged files — silently leaving them behind. Tracked changes take
precedence for the description; untracked-only maps to HasUntrackedFiles.
Sourcepub fn is_clean(&self) -> bool
pub fn is_clean(&self) -> bool
Check if the working directory is clean (no tracked changes, no untracked files)
Sourcepub fn has_tracked_changes(&self) -> bool
pub fn has_tracked_changes(&self) -> bool
Whether there are tracked changes (staged and/or unstaged), ignoring untracked files.
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get a human-readable description
Trait Implementations§
Source§impl Clone for WorkingDirState
impl Clone for WorkingDirState
Source§fn clone(&self) -> WorkingDirState
fn clone(&self) -> WorkingDirState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkingDirState
impl Debug for WorkingDirState
impl Eq for WorkingDirState
Source§impl PartialEq for WorkingDirState
impl PartialEq for WorkingDirState
Source§fn eq(&self, other: &WorkingDirState) -> bool
fn eq(&self, other: &WorkingDirState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WorkingDirState
Auto Trait Implementations§
impl Freeze for WorkingDirState
impl RefUnwindSafe for WorkingDirState
impl Send for WorkingDirState
impl Sync for WorkingDirState
impl Unpin for WorkingDirState
impl UnsafeUnpin for WorkingDirState
impl UnwindSafe for WorkingDirState
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
Mutably borrows from an owned value. Read more