diff --git a/Cargo.lock b/Cargo.lock index 9c40a357acf..8e8e82b2041 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1146,7 +1146,7 @@ dependencies = [ "is-terminal", "once_cell", "owo-colors", - "prodash 26.2.1", + "prodash 26.2.2", "serde_derive", "tabled", "time", @@ -1247,7 +1247,7 @@ dependencies = [ "is_ci", "once_cell", "parking_lot", - "prodash 26.2.1", + "prodash 26.2.2", "regex", "reqwest", "serde", @@ -1579,7 +1579,7 @@ dependencies = [ "libc", "once_cell", "parking_lot", - "prodash 26.2.1", + "prodash 26.2.2", "sha1", "sha1_smol", "thiserror", @@ -3529,9 +3529,9 @@ checksum = "9516b775656bc3e8985e19cd4b8c0c0de045095074e453d2c0a513b5f978392d" [[package]] name = "prodash" -version = "26.2.1" +version = "26.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bcc40e3e88402f12b15f94d43a2c7673365e9601cc52795e119b95a266100c" +checksum = "794b5bf8e2d19b53dcdcec3e4bba628e20f5b6062503ba89281fa7037dd7bbcf" dependencies = [ "async-io", "bytesize", diff --git a/Cargo.toml b/Cargo.toml index 906e3842f7b..0eea58e8532 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -168,7 +168,7 @@ gix = { version = "^0.53.1", path = "gix", default-features = false } time = "0.3.23" clap = { version = "4.1.1", features = ["derive", "cargo"] } -prodash = { version = "26.2.0", optional = true, default-features = false } +prodash = { workspace = true, optional = true } is-terminal = { version = "0.4.0", optional = true } env_logger = { version = "0.10.0", default-features = false } crosstermion = { version = "0.11.0", optional = true, default-features = false } @@ -292,6 +292,9 @@ members = [ "gix-traverse/tests", ] +[workspace.dependencies] +prodash = { version = "26.2.2", default-features = false } + [package.metadata.docs.rs] features = ["document-features", "max"] rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-features/Cargo.toml b/gix-features/Cargo.toml index ad68f48fbd4..82423b21665 100644 --- a/gix-features/Cargo.toml +++ b/gix-features/Cargo.toml @@ -129,7 +129,7 @@ crc32fast = { version = "1.2.1", optional = true } sha1 = { version = "0.10.0", optional = true } # progress -prodash = { version = "26.2.0", optional = true, default-features = false } +prodash = { workspace = true, optional = true } bytesize = { version = "1.0.1", optional = true } # pipe diff --git a/gix-features/src/progress.rs b/gix-features/src/progress.rs index ac8d15deb7a..6a8c9e1bdd0 100644 --- a/gix-features/src/progress.rs +++ b/gix-features/src/progress.rs @@ -9,7 +9,8 @@ pub use prodash::{ progress::{ AtomicStep, Discard, DoOrDiscard, Either, Id, Step, StepShared, Task, ThroughputOnDrop, Value, UNKNOWN, }, - unit, Count, DynNestedProgress, NestedProgress, Progress, Unit, + unit, BoxedDynNestedProgress, Count, DynNestedProgress, DynNestedProgressToNestedProgress, NestedProgress, + Progress, Unit, }; /// A stub for the portions of the `bytesize` crate that we use internally in `gitoxide`. #[cfg(not(feature = "progress-unit-bytes"))] diff --git a/gix/Cargo.toml b/gix/Cargo.toml index ea8f1efbaba..25aa9e3b1bb 100644 --- a/gix/Cargo.toml +++ b/gix/Cargo.toml @@ -243,7 +243,7 @@ gix-protocol = { version = "^0.39.0", path = "../gix-protocol", optional = true gix-transport = { version = "^0.36.0", path = "../gix-transport", optional = true } # Just to get the progress-tree feature -prodash = { version = "26.2", optional = true, default-features = false, features = ["progress-tree"] } +prodash = { workspace = true, optional = true, features = ["progress-tree"] } once_cell = "1.14.0" signal-hook = { version = "0.3.9", default-features = false, optional = true } thiserror = "1.0.26" diff --git a/gix/src/clone/fetch/mod.rs b/gix/src/clone/fetch/mod.rs index 2a18efcbc97..c03b8f83930 100644 --- a/gix/src/clone/fetch/mod.rs +++ b/gix/src/clone/fetch/mod.rs @@ -58,6 +58,15 @@ impl PrepareFetch { 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); diff --git a/gix/src/lib.rs b/gix/src/lib.rs index 342157d398f..5b8b948dc5f 100644 --- a/gix/src/lib.rs +++ b/gix/src/lib.rs @@ -87,7 +87,7 @@ pub use gix_features as features; use gix_features::threading::OwnShared; pub use gix_features::{ parallel, - progress::{Count, NestedProgress, Progress}, + progress::{Count, DynNestedProgress, NestedProgress, Progress}, threading, }; pub use gix_fs as fs; diff --git a/gix/src/remote/connection/fetch/receive_pack.rs b/gix/src/remote/connection/fetch/receive_pack.rs index 66fe0fee05c..18e5ac15955 100644 --- a/gix/src/remote/connection/fetch/receive_pack.rs +++ b/gix/src/remote/connection/fetch/receive_pack.rs @@ -73,12 +73,21 @@ where /// - `gitoxide.userAgent` is read to obtain the application user agent for git servers and for HTTP servers as well. /// #[gix_protocol::maybe_async::maybe_async] - #[allow(clippy::drop_non_drop)] - pub async fn receive
(mut self, mut progress: P, should_interrupt: &AtomicBool) -> Result (self, mut progress: P, should_interrupt: &AtomicBool) -> Result (
- progress: &mut P,
+fn setup_remote_progress(
+ progress: &mut dyn crate::DynNestedProgress,
reader: &mut Box