pub enum WorktreeIdentity {
OutsideWorktree,
BareRepository {
common_dir: PathBuf,
git_dir: PathBuf,
},
MainWorktree {
common_dir: PathBuf,
git_dir: PathBuf,
worktree_root: PathBuf,
},
LinkedWorktree {
common_dir: PathBuf,
git_dir: PathBuf,
worktree_root: PathBuf,
},
}Expand description
What:
The repository shape an invocation selects.
#[derive(...)] generates cloning,
debug printing and ==.
Why:
Each shape needs different handling:
no repository means no configuration,
a bare repository has no worktree,
and main versus linked decides worktree
policies.
All paths are Git’s own canonical absolute paths.
In TS you’d write (pseudocode):
type WorktreeIdentity = { kind: 'outside-worktree' } | { kind: 'bare-repository'; ... } | ...;Variants§
OutsideWorktree
No repository,
or a repository location without a worktree (inside .git).
BareRepository
A bare repository: Git directories but no worktree.
Fields
MainWorktree
The main worktree: its Git directory is the common directory.
Fields
LinkedWorktree
A linked worktree: its Git directory is separate from the common directory.
Trait Implementations§
Source§impl Clone for WorktreeIdentity
impl Clone for WorktreeIdentity
Source§impl Debug for WorktreeIdentity
impl Debug for WorktreeIdentity
impl Eq for WorktreeIdentity
Source§impl PartialEq for WorktreeIdentity
impl PartialEq for WorktreeIdentity
impl StructuralPartialEq for WorktreeIdentity
Auto Trait Implementations§
impl Freeze for WorktreeIdentity
impl RefUnwindSafe for WorktreeIdentity
impl Send for WorktreeIdentity
impl Sync for WorktreeIdentity
impl Unpin for WorktreeIdentity
impl UnsafeUnpin for WorktreeIdentity
impl UnwindSafe for WorktreeIdentity
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
Mutably borrows from an owned value. Read more
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more