pub enum CreateReflink {
Never,
Auto,
}Expand description
Whether to materialize a new worktree by copy-on-write cloning an existing
one’s files instead of checking them out ([create] reflink).
On a CoW filesystem (btrfs, XFS with reflink=1, APFS, ReFS) this shares the
extents of every file, so a new worktree of a large repository costs almost
no disk and almost no writing. It also carries the source’s ignored build
output along, which is usually the point and occasionally not. The source’s
untracked files are left behind, so the new worktree still comes up clean and
Config::copy still governs which non-tracked files travel.
Off by default: it only pays off on a CoW filesystem, and copying a source’s
ignored files is a bigger behavioural change than seeding.
auto uses it when the filesystem supports it and a source worktree is
already at the same tree, and silently checks out normally otherwise.
Variants§
Never
Never clone; always check out (the default).
Auto
Clone when the filesystem and the source worktree allow it.
Implementations§
Source§impl CreateReflink
impl CreateReflink
Sourcepub fn parse(value: &str) -> Option<CreateReflink>
pub fn parse(value: &str) -> Option<CreateReflink>
Parses a create.reflink value (auto, never).
Sourcepub fn is_enabled(self) -> bool
pub fn is_enabled(self) -> bool
Whether copy-on-write materialization is enabled.
Sourcepub fn identifier(self) -> &'static str
pub fn identifier(self) -> &'static str
The config identifier this strategy round-trips through.
Trait Implementations§
Source§impl Clone for CreateReflink
impl Clone for CreateReflink
impl Copy for CreateReflink
Source§impl Debug for CreateReflink
impl Debug for CreateReflink
Source§impl Default for CreateReflink
impl Default for CreateReflink
impl Eq for CreateReflink
Source§impl PartialEq for CreateReflink
impl PartialEq for CreateReflink
impl StructuralPartialEq for CreateReflink
Auto Trait Implementations§
impl Freeze for CreateReflink
impl RefUnwindSafe for CreateReflink
impl Send for CreateReflink
impl Sync for CreateReflink
impl Unpin for CreateReflink
impl UnsafeUnpin for CreateReflink
impl UnwindSafe for CreateReflink
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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