Struct gix::clone::PrepareCheckout
source · pub struct PrepareCheckout { /* private fields */ }
worktree-mutation
only.Expand description
A utility to collect configuration on how to perform a checkout into a working tree, and when dropped without checking out successfully the fetched repository will be dropped.
Implementations§
source§impl PrepareCheckout
impl PrepareCheckout
Modification
sourcepub fn main_worktree<P>(
&mut self,
progress: P,
should_interrupt: &AtomicBool
) -> Result<(Repository, Outcome), Error>where
P: NestedProgress,
P::SubProgress: NestedProgress + 'static,
pub fn main_worktree<P>( &mut self, progress: P, should_interrupt: &AtomicBool ) -> Result<(Repository, Outcome), Error>where P: NestedProgress, P::SubProgress: NestedProgress + 'static,
Checkout the main worktree, determining how many threads to use by looking at checkout.workers
, defaulting to using
on thread per logical core.
Note that this is a no-op if the remote was empty, leaving this repository empty as well. This can be validated by checking
if the head()
of the returned repository is not unborn.
source§impl PrepareCheckout
impl PrepareCheckout
Access
sourcepub fn repo(&self) -> &Repository
pub fn repo(&self) -> &Repository
Get access to the repository while the checkout isn’t yet completed.
Panics
If the checkout is completed and the Repository
was already passed on to the caller.
source§impl PrepareCheckout
impl PrepareCheckout
Consumption
sourcepub fn persist(self) -> Repository
pub fn persist(self) -> Repository
Persist the contained repository as is even if an error may have occurred when checking out the main working tree.