@@ -74,19 +74,28 @@ where
74
74
///
75
75
#[ gix_protocol:: maybe_async:: maybe_async]
76
76
#[ allow( clippy:: drop_non_drop) ]
77
- pub async fn receive < P > ( mut self , mut progress : P , should_interrupt : & AtomicBool ) -> Result < Outcome , Error >
77
+ pub async fn receive < P > ( self , mut progress : P , should_interrupt : & AtomicBool ) -> Result < Outcome , Error >
78
78
where
79
79
P : gix_features:: progress:: NestedProgress ,
80
80
P :: SubProgress : ' static ,
81
81
{
82
+ self . receive_inner ( & mut progress, should_interrupt)
83
+ }
84
+
85
+ #[ gix_protocol:: maybe_async:: maybe_async]
86
+ #[ allow( clippy:: drop_non_drop) ]
87
+ pub ( crate ) async fn receive_inner (
88
+ mut self ,
89
+ progress : & mut dyn crate :: DynNestedProgress ,
90
+ should_interrupt : & AtomicBool ,
91
+ ) -> Result < Outcome , Error > {
82
92
let _span = gix_trace:: coarse!( "fetch::Prepare::receive()" ) ;
83
93
let mut con = self . con . take ( ) . expect ( "receive() can only be called once" ) ;
84
94
85
95
let handshake = & self . ref_map . handshake ;
86
96
let protocol_version = handshake. server_protocol_version ;
87
97
88
98
let fetch = gix_protocol:: Command :: Fetch ;
89
- let progress = & mut progress;
90
99
let repo = con. remote . repo ;
91
100
let fetch_features = {
92
101
let mut f = fetch. default_features ( protocol_version, & handshake. capabilities ) ;
@@ -379,17 +388,14 @@ fn add_shallow_args(
379
388
Ok ( ( shallow_commits, shallow_lock) )
380
389
}
381
390
382
- fn setup_remote_progress < P > (
383
- progress : & mut P ,
391
+ fn setup_remote_progress (
392
+ progress : & mut dyn crate :: DynNestedProgress ,
384
393
reader : & mut Box < dyn gix_protocol:: transport:: client:: ExtendedBufRead + Unpin + ' _ > ,
385
394
should_interrupt : & AtomicBool ,
386
- ) where
387
- P : gix_features:: progress:: NestedProgress ,
388
- P :: SubProgress : ' static ,
389
- {
395
+ ) {
390
396
use gix_protocol:: transport:: client:: ExtendedBufRead ;
391
397
reader. set_progress_handler ( Some ( Box :: new ( {
392
- let mut remote_progress = progress. add_child_with_id ( "remote" , ProgressId :: RemoteProgress . into ( ) ) ;
398
+ let mut remote_progress = progress. add_child_with_id ( "remote" . to_string ( ) , ProgressId :: RemoteProgress . into ( ) ) ;
393
399
// SAFETY: Ugh, so, with current Rust I can't declare lifetimes in the involved traits the way they need to
394
400
// be and I also can't use scoped threads to pump from local scopes to an Arc version that could be
395
401
// used here due to the this being called from sync AND async code (and the async version doesn't work
0 commit comments