summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/clone
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix/src/clone
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/clone')
-rw-r--r--vendor/gix/src/clone/access.rs6
-rw-r--r--vendor/gix/src/clone/fetch/mod.rs30
-rw-r--r--vendor/gix/src/clone/fetch/util.rs2
-rw-r--r--vendor/gix/src/clone/mod.rs2
4 files changed, 23 insertions, 17 deletions
diff --git a/vendor/gix/src/clone/access.rs b/vendor/gix/src/clone/access.rs
index 5b6e5fbab..1c817e939 100644
--- a/vendor/gix/src/clone/access.rs
+++ b/vendor/gix/src/clone/access.rs
@@ -1,6 +1,4 @@
-use crate::bstr::BString;
-use crate::clone::PrepareFetch;
-use crate::Repository;
+use crate::{bstr::BString, clone::PrepareFetch, Repository};
/// Builder
impl PrepareFetch {
@@ -12,7 +10,7 @@ impl PrepareFetch {
/// _all changes done in `f()` will be persisted_.
///
/// It can also be used to configure additional options, like those for fetching tags. Note that
- /// [with_fetch_tags()][crate::Remote::with_fetch_tags()] should be called here to configure the clone as desired.
+ /// [`with_fetch_tags()`][crate::Remote::with_fetch_tags()] should be called here to configure the clone as desired.
/// Otherwise a clone is configured to be complete and fetches all tags, not only those reachable from all branches.
pub fn configure_remote(
mut self,
diff --git a/vendor/gix/src/clone/fetch/mod.rs b/vendor/gix/src/clone/fetch/mod.rs
index 59f820675..e20cc96cb 100644
--- a/vendor/gix/src/clone/fetch/mod.rs
+++ b/vendor/gix/src/clone/fetch/mod.rs
@@ -44,7 +44,12 @@ impl PrepareFetch {
/// it was newly initialized.
///
/// Note that all data we created will be removed once this instance drops if the operation wasn't successful.
- pub fn fetch_only<P>(
+ ///
+ /// ### Note for users of `async`
+ ///
+ /// Even though
+ #[gix_protocol::maybe_async::maybe_async]
+ pub async fn fetch_only<P>(
&mut self,
mut progress: P,
should_interrupt: &std::sync::atomic::AtomicBool,
@@ -101,17 +106,19 @@ impl PrepareFetch {
.expect("valid")
.to_owned();
let pending_pack: remote::fetch::Prepare<'_, '_, _> = {
- let mut connection = remote.connect(remote::Direction::Fetch)?;
+ let mut connection = remote.connect(remote::Direction::Fetch).await?;
if let Some(f) = self.configure_connection.as_mut() {
f(&mut connection).map_err(|err| Error::RemoteConnection(err))?;
}
- connection.prepare_fetch(&mut progress, {
- let mut opts = self.fetch_options.clone();
- if !opts.extra_refspecs.contains(&head_refspec) {
- opts.extra_refspecs.push(head_refspec)
- }
- opts
- })?
+ connection
+ .prepare_fetch(&mut progress, {
+ let mut opts = self.fetch_options.clone();
+ if !opts.extra_refspecs.contains(&head_refspec) {
+ opts.extra_refspecs.push(head_refspec)
+ }
+ opts
+ })
+ .await?
};
if pending_pack.ref_map().object_hash != repo.object_hash() {
unimplemented!("configure repository to expect a different object hash as advertised by the server")
@@ -127,7 +134,8 @@ impl PrepareFetch {
message: reflog_message.clone(),
})
.with_shallow(self.shallow.clone())
- .receive(progress, should_interrupt)?;
+ .receive(progress, should_interrupt)
+ .await?;
util::append_config_to_repo_config(repo, config);
util::update_head(
@@ -141,6 +149,7 @@ 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")]
pub fn fetch_then_checkout<P>(
&mut self,
progress: P,
@@ -155,5 +164,4 @@ impl PrepareFetch {
}
}
-#[cfg(feature = "blocking-network-client")]
mod util;
diff --git a/vendor/gix/src/clone/fetch/util.rs b/vendor/gix/src/clone/fetch/util.rs
index ac8943f6e..cb79669ac 100644
--- a/vendor/gix/src/clone/fetch/util.rs
+++ b/vendor/gix/src/clone/fetch/util.rs
@@ -185,7 +185,7 @@ pub fn update_head(
/// Setup the remote configuration for `branch` so that it points to itself, but on the remote, if and only if currently
/// saved refspecs are able to match it.
-/// For that we reload the remote of `remote_name` and use its ref_specs for match.
+/// For that we reload the remote of `remote_name` and use its `ref_specs` for match.
fn setup_branch_config(
repo: &mut Repository,
branch: &FullNameRef,
diff --git a/vendor/gix/src/clone/mod.rs b/vendor/gix/src/clone/mod.rs
index 43024e0b4..9ec226135 100644
--- a/vendor/gix/src/clone/mod.rs
+++ b/vendor/gix/src/clone/mod.rs
@@ -160,7 +160,7 @@ mod access_feat {
}
///
-#[cfg(feature = "blocking-network-client")]
+#[cfg(any(feature = "async-network-client-async-std", feature = "blocking-network-client"))]
pub mod fetch;
///