#[non_exhaustive]pub enum LinkedWorktreeError {
Show 21 variants
BareRepository,
NotRegistered {
path: PathBuf,
},
MainWorktree {
operation: LinkedWorktreeOperation,
},
Locked {
reason: Option<String>,
},
AlreadyLocked {
reason: Option<String>,
},
NotLocked,
HasLocalChanges,
HasSubmodules,
PathRegistered {
path: PathBuf,
},
PathRegisteredMissing {
path: PathBuf,
},
PathExists {
path: PathBuf,
},
PathExistsNotDirectory {
path: PathBuf,
},
NotADirectory {
path: PathBuf,
},
PathNotFound {
path: PathBuf,
},
NoFileName {
path: PathBuf,
},
InvalidAdminDir {
path: PathBuf,
},
BranchTipMismatch {
branch: String,
},
DotGitIsDirectory {
path: PathBuf,
},
BrokenGitFile {
path: PathBuf,
},
LockHeld {
path: PathBuf,
},
NonUtf8SubmodulePath {
path: Vec<u8>,
},
}Expand description
Linked worktree registry failures (add, remove, move, lock, repair).
Wrapped by WorktreeError::Linked and surfaced as
Error::Worktree. Branch problems during add use
BranchError; a branch checked out elsewhere uses
crate::porcelain::branch_error::BranchError::CheckedOut.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BareRepository
Linked worktrees cannot be added to a bare repository.
NotRegistered
No registered worktree has path as its working tree root.
MainWorktree
The operation only applies to linked worktrees.
Fields
operation: LinkedWorktreeOperationOperation that was refused.
Locked
The worktree is locked and the caller did not force the operation.
AlreadyLocked
Lock was requested for a worktree that is already locked.
NotLocked
Unlock was requested for a worktree that is not locked.
HasLocalChanges
Remove without force found staged, unstaged, conflicted or untracked changes.
HasSubmodules
Move found populated submodules inside the worktree.
PathRegistered
The path is registered to a worktree whose directory still exists.
PathRegisteredMissing
The path is registered to a worktree whose directory is missing, and add was not forced.
PathExists
The target directory exists and is not empty (add) or exists at all (move).
PathExistsNotDirectory
The add target exists and is a file or other non-directory.
NotADirectory
A path that must be a directory (repair target, move destination parent) is not one.
PathNotFound
A repair target does not exist.
NoFileName
The path has no final component to name the worktree after (for example /).
InvalidAdminDir
A worktree admin directory has no parent directory.
BranchTipMismatch
An existing branch used for the worktree HEAD does not point at the start commit.
DotGitIsDirectory
Repair expected a .git gitfile but found a directory.
BrokenGitFile
Repair could not map a worktree’s .git gitfile to a registered admin directory.
LockHeld
Another process holds the lock file guarding a worktree link file.
NonUtf8SubmodulePath
A gitlink entry in the worktree index has a path that is not valid UTF-8.
Trait Implementations§
Source§impl Clone for LinkedWorktreeError
impl Clone for LinkedWorktreeError
Source§impl Debug for LinkedWorktreeError
impl Debug for LinkedWorktreeError
Source§impl Display for LinkedWorktreeError
impl Display for LinkedWorktreeError
impl Eq for LinkedWorktreeError
Source§impl Error for LinkedWorktreeError
impl Error for LinkedWorktreeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<LinkedWorktreeError> for Error
impl From<LinkedWorktreeError> for Error
Source§fn from(value: LinkedWorktreeError) -> Self
fn from(value: LinkedWorktreeError) -> Self
Source§impl From<LinkedWorktreeError> for WorktreeError
impl From<LinkedWorktreeError> for WorktreeError
Source§fn from(source: LinkedWorktreeError) -> Self
fn from(source: LinkedWorktreeError) -> Self
Source§impl PartialEq for LinkedWorktreeError
impl PartialEq for LinkedWorktreeError
impl StructuralPartialEq for LinkedWorktreeError
Auto Trait Implementations§
impl Forget for LinkedWorktreeError
impl Freeze for LinkedWorktreeError
impl RefUnwindSafe for LinkedWorktreeError
impl Send for LinkedWorktreeError
impl Sync for LinkedWorktreeError
impl Unpin for LinkedWorktreeError
impl UnsafeUnpin for LinkedWorktreeError
impl UnwindSafe for LinkedWorktreeError
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.