pub enum RemoveBlockReason {
StagedChanges,
LocalModifications,
StagedAndLocal,
}Expand description
Why remove_paths refused to remove a path without RemoveOptions::force.
Variants§
StagedChanges
The index entry differs from HEAD (or there is no HEAD commit yet) while the work
tree file matches the index. Deleting the file would lose the staged content;
RemoveOptions::cached keeps it on disk.
LocalModifications
The work tree file differs from the index while the index matches HEAD. Deleting
the file would lose the edits; RemoveOptions::cached keeps it on disk.
StagedAndLocal
The index entry differs from both HEAD and the work tree file, so the staged
content exists nowhere else. Refused even with RemoveOptions::cached.
Implementations§
Source§impl RemoveBlockReason
impl RemoveBlockReason
Sourcepub fn classify(staged: bool, local: bool, cached: bool) -> Option<Self>
pub fn classify(staged: bool, local: bool, cached: bool) -> Option<Self>
Decide whether a path is refused, given how its index entry compares.
§Parameters
staged: the index entry differs fromHEAD, or there is noHEADcommit.local: the work tree file differs from the index entry.cached: the removal keeps the work tree file (RemoveOptions::cached).
§Returns
None when the path may be removed without force.
Sourcepub fn allowed_with_cached(self) -> bool
pub fn allowed_with_cached(self) -> bool
Whether retrying with RemoveOptions::cached would remove the path.
Trait Implementations§
Source§impl Clone for RemoveBlockReason
impl Clone for RemoveBlockReason
impl Copy for RemoveBlockReason
Source§impl Debug for RemoveBlockReason
impl Debug for RemoveBlockReason
Source§impl Display for RemoveBlockReason
impl Display for RemoveBlockReason
impl Eq for RemoveBlockReason
Source§impl Hash for RemoveBlockReason
impl Hash for RemoveBlockReason
Source§impl PartialEq for RemoveBlockReason
impl PartialEq for RemoveBlockReason
impl StructuralPartialEq for RemoveBlockReason
Auto Trait Implementations§
impl Freeze for RemoveBlockReason
impl RefUnwindSafe for RemoveBlockReason
impl Send for RemoveBlockReason
impl Sync for RemoveBlockReason
impl Unpin for RemoveBlockReason
impl UnsafeUnpin for RemoveBlockReason
impl UnwindSafe for RemoveBlockReason
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.