Function gix_worktree::checkout
source · pub fn checkout<Find, E>(
index: &mut State,
dir: impl Into<PathBuf>,
find: Find,
files: &mut impl Progress,
bytes: &mut impl Progress,
should_interrupt: &AtomicBool,
options: Options
) -> Result<Outcome, Error<E>>where
Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<BlobRef<'a>, E> + Send + Clone,
E: Error + Send + Sync + 'static,Expand description
Checkout the entire index into dir, and resolve objects found in index entries with find to write their content to their
respective path in dir.
Use files to count each fully checked out file, and count the amount written bytes. If should_interrupt is true, the
operation will abort.
options provide a lot of context on how to perform the operation.
Handling the return value
Note that interruption still produce an Ok(…) value, so the caller should look at should_interrupt to communicate the outcome.