summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/clone/fetch/mod.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix/src/clone/fetch/mod.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/clone/fetch/mod.rs')
-rw-r--r--vendor/gix/src/clone/fetch/mod.rs21
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)?;