pub struct FileChange { /* private fields */ }Expand description
A file change within a repository.
Values of this type are returned by Repository::file_change and yielded
by iterators over RepositoryChanges returned by
Repository::repository_changes and Repository::path_changes.
Instances of this type always represent a dirty file, a staged file, or
both. Dirty files have unstaged modifications or are untracked. Clean
tracked files and files ignored by the VCS are not represented;
Repository::file_change returns None for those cases.
The stored path is the worktree-relative path associated with this change in the VCS. It may refer to a tracked path that is no longer present in the worktree.
More than one predicate may return true for the same file. For example,
a file may have staged changes and additional unstaged tracked
modifications.
Implementations§
Source§impl FileChange
impl FileChange
Sourcepub fn wt_path(&self) -> &Path
pub fn wt_path(&self) -> &Path
Returns the worktree-relative path associated with this file change in the VCS.
This may refer to a tracked path that is no longer present in the worktree.
When this change is returned by Repository::file_change, the
returned path may differ from the path passed to that method when the
input reaches the same path through symlinks or other equivalent
non-canonical forms.
Trait Implementations§
Source§impl Clone for FileChange
impl Clone for FileChange
Source§fn clone(&self) -> FileChange
fn clone(&self) -> FileChange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more