pub enum Change<T = (), U = ()> {
Removed,
Type,
Modification {
executable_bit_changed: bool,
content_change: Option<T>,
set_entry_stat_size_zero: bool,
},
SubmoduleModification(U),
}
Expand description
How an index entry needs to be changed to obtain the destination worktree state, i.e. entry.apply(this_change) == worktree-entry
.
Variants§
Removed
This corresponding file does not exist in the worktree anymore.
Type
The type of file changed compared to the worktree, i.e. a symlink s now a file.
Modification
This worktree file was modified in some form, like a permission change or content change or both, as compared to this entry.
Fields
executable_bit_changed: bool
Indicates that one of the stat changes was an executable bit change which is a significant change itself.
content_change: Option<T>
The output of the CompareBlobs
run on this entry.
If there is no content change and only the executable bit
changed then this is None
.
set_entry_stat_size_zero: bool
If true, the caller is expected to set entry.stat.size = 0 to assure this otherwise racily clean entry can still be detected as dirty next time this is called, but this time without reading it from disk to hash it. It’s a performance optimization and not doing so won’t change the correctness of the operation.
SubmoduleModification(U)
A submodule is initialized and checked out, and there was modification to either:
- the
HEAD
as compared to the superproject’s desired commit forHEAD
- the worktree has at least one modified file
- there is at least one untracked file
The exact nature of the modification is handled by the caller which may retain information per submodule or re-compute details as needed when seeing this variant.
Trait Implementations§
source§impl<T, U> From<Change<T, U>> for EntryStatus<T, U>
impl<T, U> From<Change<T, U>> for EntryStatus<T, U>
source§impl<T: Ord, U: Ord> Ord for Change<T, U>
impl<T: Ord, U: Ord> Ord for Change<T, U>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<T: PartialOrd, U: PartialOrd> PartialOrd for Change<T, U>
impl<T: PartialOrd, U: PartialOrd> PartialOrd for Change<T, U>
impl<T: Eq, U: Eq> Eq for Change<T, U>
impl<T, U> StructuralPartialEq for Change<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Change<T, U>
impl<T, U> RefUnwindSafe for Change<T, U>where
U: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, U> Send for Change<T, U>
impl<T, U> Sync for Change<T, U>
impl<T, U> Unpin for Change<T, U>
impl<T, U> UnwindSafe for Change<T, U>where
U: UnwindSafe,
T: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)