From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix/src/clone/checkout.rs | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'vendor/gix/src/clone/checkout.rs') diff --git a/vendor/gix/src/clone/checkout.rs b/vendor/gix/src/clone/checkout.rs index 823005551..ece480a56 100644 --- a/vendor/gix/src/clone/checkout.rs +++ b/vendor/gix/src/clone/checkout.rs @@ -26,9 +26,7 @@ pub mod main_worktree { #[error(transparent)] CheckoutOptions(#[from] crate::config::checkout_options::Error), #[error(transparent)] - IndexCheckout( - #[from] gix_worktree::checkout::Error>, - ), + IndexCheckout(#[from] gix_worktree_state::checkout::Error), #[error("Failed to reopen object database as Arc (only if thread-safety wasn't compiled in)")] OpenArcOdb(#[from] std::io::Error), #[error("The HEAD reference could not be located")] @@ -64,11 +62,24 @@ pub mod main_worktree { /// /// 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. - pub fn main_worktree( + pub fn main_worktree

( &mut self, - mut progress: impl crate::Progress, + mut progress: P, should_interrupt: &AtomicBool, - ) -> Result<(Repository, gix_worktree::checkout::Outcome), Error> { + ) -> Result<(Repository, gix_worktree_state::checkout::Outcome), Error> + where + P: gix_features::progress::NestedProgress, + P::SubProgress: gix_features::progress::NestedProgress + 'static, + { + self.main_worktree_inner(&mut progress, should_interrupt) + } + + fn main_worktree_inner( + &mut self, + progress: &mut dyn gix_features::progress::DynNestedProgress, + should_interrupt: &AtomicBool, + ) -> Result<(Repository, gix_worktree_state::checkout::Outcome), Error> { + let _span = gix_trace::coarse!("gix::clone::PrepareCheckout::main_worktree()"); let repo = self .repo .as_ref() @@ -81,7 +92,7 @@ pub mod main_worktree { None => { return Ok(( self.repo.take().expect("still present"), - gix_worktree::checkout::Outcome::default(), + gix_worktree_state::checkout::Outcome::default(), )) } }; @@ -92,25 +103,27 @@ pub mod main_worktree { })?; let mut index = gix_index::File::from_state(index, repo.index_path()); - let mut opts = repo.config.checkout_options(repo.git_dir())?; + let mut opts = repo + .config + .checkout_options(repo, gix_worktree::stack::state::attributes::Source::IdMapping)?; opts.destination_is_initially_empty = true; - let mut files = progress.add_child_with_id("checkout", ProgressId::CheckoutFiles.into()); - let mut bytes = progress.add_child_with_id("writing", ProgressId::BytesWritten.into()); + let mut files = progress.add_child_with_id("checkout".to_string(), ProgressId::CheckoutFiles.into()); + let mut bytes = progress.add_child_with_id("writing".to_string(), ProgressId::BytesWritten.into()); files.init(Some(index.entries().len()), crate::progress::count("files")); bytes.init(None, crate::progress::bytes()); let start = std::time::Instant::now(); - let outcome = gix_worktree::checkout( + let outcome = gix_worktree_state::checkout( &mut index, workdir, { let objects = repo.objects.clone().into_arc()?; move |oid, buf| objects.find_blob(oid, buf) }, - &mut files, - &mut bytes, + &files, + &bytes, should_interrupt, opts, )?; -- cgit v1.2.3