pub struct RepositoryChanges { /* private fields */ }Expand description
A non-empty set of file changes.
Values of this type are returned by Repository::repository_changes and
Repository::path_changes.
This type contains only dirty and/or staged files. Dirty files have
unstaged modifications or are untracked. Clean tracked files are not
included. Files ignored by the VCS are also omitted
because this crate is intended for --allow-* style checks, which treat
them the same as clean files.
Repository::repository_changes and Repository::path_changes return
None instead of an empty change set.
File changes are ordered by ascending worktree-relative path. Entries may include tracked paths that are no longer present in the worktree.
Implementations§
Source§impl RepositoryChanges
impl RepositoryChanges
Sourcepub fn files(&self) -> Files<'_> ⓘ
pub fn files(&self) -> Files<'_> ⓘ
Returns an iterator over all file changes in this change set.
Files are yielded in ascending worktree-relative path order.
Sourcepub fn dirty_files(&self) -> DirtyFiles<'_> ⓘ
pub fn dirty_files(&self) -> DirtyFiles<'_> ⓘ
Returns an iterator over dirty files in this change set.
A dirty file has unstaged modifications or is untracked. Staged-only changes are not considered dirty. Files are yielded in ascending worktree-relative path order.
Sourcepub fn staged_files(&self) -> StagedFiles<'_> ⓘ
pub fn staged_files(&self) -> StagedFiles<'_> ⓘ
Returns an iterator over files with staged changes in this change set.
Files are yielded in ascending worktree-relative path order.
Sourcepub fn has_dirty_files(&self) -> bool
pub fn has_dirty_files(&self) -> bool
Returns whether this change set contains any dirty files.
A dirty file has unstaged modifications or is untracked. Staged-only changes are not considered dirty.
Sourcepub fn has_staged_files(&self) -> bool
pub fn has_staged_files(&self) -> bool
Returns whether this change set contains any files with staged changes.
Trait Implementations§
Source§impl Clone for RepositoryChanges
impl Clone for RepositoryChanges
Source§fn clone(&self) -> RepositoryChanges
fn clone(&self) -> RepositoryChanges
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more