diff options
Diffstat (limited to 'vendor/gix/src/clone/fetch/mod.rs')
-rw-r--r-- | vendor/gix/src/clone/fetch/mod.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vendor/gix/src/clone/fetch/mod.rs b/vendor/gix/src/clone/fetch/mod.rs index e20cc96cb..c03b8f839 100644 --- a/vendor/gix/src/clone/fetch/mod.rs +++ b/vendor/gix/src/clone/fetch/mod.rs @@ -26,7 +26,7 @@ pub enum Error { SaveConfigIo(#[from] std::io::Error), #[error("The remote HEAD points to a reference named {head_ref_name:?} which is invalid.")] InvalidHeadRef { - source: gix_validate::refname::Error, + source: gix_validate::reference::name::Error, head_ref_name: crate::bstr::BString, }, #[error("Failed to update HEAD with values from remote")] @@ -55,9 +55,18 @@ impl PrepareFetch { should_interrupt: &std::sync::atomic::AtomicBool, ) -> Result<(crate::Repository, crate::remote::fetch::Outcome), Error> where - P: crate::Progress, + P: crate::NestedProgress, P::SubProgress: 'static, { + self.fetch_only_inner(&mut progress, should_interrupt).await + } + + #[gix_protocol::maybe_async::maybe_async] + async fn fetch_only_inner( + &mut self, + progress: &mut dyn crate::DynNestedProgress, + should_interrupt: &std::sync::atomic::AtomicBool, + ) -> Result<(crate::Repository, crate::remote::fetch::Outcome), Error> { use crate::{bstr::ByteVec, remote, remote::fetch::RefLogMessage}; let repo = self @@ -111,7 +120,7 @@ impl PrepareFetch { f(&mut connection).map_err(|err| Error::RemoteConnection(err))?; } connection - .prepare_fetch(&mut progress, { + .prepare_fetch(&mut *progress, { let mut opts = self.fetch_options.clone(); if !opts.extra_refspecs.contains(&head_refspec) { opts.extra_refspecs.push(head_refspec) @@ -134,7 +143,7 @@ impl PrepareFetch { message: reflog_message.clone(), }) .with_shallow(self.shallow.clone()) - .receive(progress, should_interrupt) + .receive_inner(progress, should_interrupt) .await?; util::append_config_to_repo_config(repo, config); @@ -149,14 +158,14 @@ impl PrepareFetch { } /// Similar to [`fetch_only()`][Self::fetch_only()`], but passes ownership to a utility type to configure a checkout operation. - #[cfg(feature = "blocking-network-client")] + #[cfg(all(feature = "worktree-mutation", feature = "blocking-network-client"))] pub fn fetch_then_checkout<P>( &mut self, progress: P, should_interrupt: &std::sync::atomic::AtomicBool, ) -> Result<(crate::clone::PrepareCheckout, crate::remote::fetch::Outcome), Error> where - P: crate::Progress, + P: crate::NestedProgress, P::SubProgress: 'static, { let (repo, fetch_outcome) = self.fetch_only(progress, should_interrupt)?; |