pub enum Checkout {
Repository,
Linked,
Submodule,
}Expand description
What the .git at a work tree root actually is.
is_work_tree_root deliberately collapses all three, which is right for the safety model’s
question — “is there a checkout here” — and wrong for the only question where the difference
decides whether a directory is disposable.
A linked work tree is the one kind that holds no history of its own. Its commits go to the
repository’s object store and its branch is an ordinary ref there, so deleting the directory
costs the checked-out files and nothing else — verified rather than assumed: a commit made in
a linked work tree is still readable through its branch after the directory is removed
outright. A Repository is the object store, and a
Submodule is a checkout the superproject’s index points at, which is a
different promise from “somewhere to do some work”.
Variants§
Repository
.git is a directory: the repository itself, holding every object and ref under it.
Linked
.git is a file pointing into another repository’s worktrees/, which is where the
objects and the branch actually live.
Submodule
.git is a file pointing into a superproject’s modules/.
Trait Implementations§
impl Copy for Checkout
impl Eq for Checkout
impl StructuralPartialEq for Checkout
Auto Trait Implementations§
impl Freeze for Checkout
impl RefUnwindSafe for Checkout
impl Send for Checkout
impl Sync for Checkout
impl Unpin for Checkout
impl UnsafeUnpin for Checkout
impl UnwindSafe for Checkout
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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