pub enum Status {
Pruned,
Tracked,
Ignored(Kind),
Untracked,
}
Expand description
The kind of entry as obtained from a directory.
Variants§
Pruned
The entry was removed from the walk due to its other properties, like Property or PathspecMatch
Note that entries flagged as DotGit
directory will always be considered Pruned
, but if they are
also ignored, in delete mode, they will be considered Ignored
instead. This way, it’s easier to remove them
while they will not be available for any interactions in read-only mode.
Tracked
The entry is tracked in Git.
Ignored(Kind)
The entry is ignored as per .gitignore
files and their rules.
If this is a directory, then its entire contents is ignored. Otherwise, possibly due to configuration, individual ignored files are listed.
Untracked
The entry is not tracked by git yet, it was not found in the index.
If it’s a directory, the entire directory contents is untracked.
Implementations§
source§impl Status
impl Status
sourcepub fn is_pruned(&self) -> bool
pub fn is_pruned(&self) -> bool
Return true if this status is considered pruned. A pruned entry is typically hidden from view due to a pathspec.
sourcepub fn can_recurse(
&self,
file_type: Option<Kind>,
pathspec_match: Option<PathspecMatch>,
for_deletion: Option<ForDeletionMode>,
worktree_root_is_repository: bool,
) -> bool
pub fn can_recurse( &self, file_type: Option<Kind>, pathspec_match: Option<PathspecMatch>, for_deletion: Option<ForDeletionMode>, worktree_root_is_repository: bool, ) -> bool
Return true
if file_type
is a directory on disk and isn’t ignored, and is not a repository.
This implements the default rules of git status
, which is good for a minimal traversal through
tracked and non-ignored portions of a worktree.
for_deletion
is used to determine if recursion into a directory is allowed even though it otherwise wouldn’t be.
If worktree_root_is_repository
is true
, then this status is part of the root of an iteration, and the corresponding
worktree root is a repository itself. This typically happens for submodules. In this case, recursion rules are relaxed
to allow traversing submodule worktrees.
Use pathspec_match
to determine if a pathspec matches in any way, affecting the decision to recurse.
Trait Implementations§
source§impl Ord for Status
impl Ord for Status
source§impl PartialEq for Status
impl PartialEq for Status
source§impl PartialOrd for Status
impl PartialOrd for Status
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Status
impl Eq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)