@@ -72,9 +72,9 @@ pub(crate) mod hero {
7272 #[ cfg( feature = "fetch" ) ]
7373 mod fetch {
7474 #[ cfg( feature = "async-client" ) ]
75- use crate :: transport:: client:: async_io:: Transport ;
75+ use crate :: transport:: client:: async_io;
7676 #[ cfg( feature = "blocking-client" ) ]
77- use crate :: transport:: client:: blocking_io:: Transport ;
77+ use crate :: transport:: client:: blocking_io;
7878 use crate :: { fetch:: RefMap , Handshake } ;
7979 use gix_features:: progress:: Progress ;
8080 use std:: borrow:: Cow ;
@@ -86,12 +86,12 @@ pub(crate) mod hero {
8686
8787 impl FetchRefMap < ' _ > {
8888 /// Fetch the refmap, either by returning the existing one or invoking the command.
89+ #[ cfg( feature = "async-client" ) ]
8990 #[ allow( clippy:: result_large_err) ]
90- #[ maybe_async:: maybe_async]
91- pub async fn fetch (
91+ pub async fn fetch_async (
9292 self ,
9393 mut progress : impl Progress ,
94- transport : & mut impl Transport ,
94+ transport : & mut impl async_io :: Transport ,
9595 trace_packetlines : bool ,
9696 ) -> Result < crate :: fetch:: RefMap , crate :: fetch:: refmap:: init:: Error > {
9797 let ( cmd, cx) = match self {
@@ -100,7 +100,26 @@ pub(crate) mod hero {
100100 } ;
101101
102102 let capabilities = cmd. capabilities ;
103- let remote_refs = cmd. invoke ( transport, & mut progress, trace_packetlines) . await ?;
103+ let remote_refs = cmd. invoke_async ( transport, & mut progress, trace_packetlines) . await ?;
104+ RefMap :: from_refs ( remote_refs, capabilities, cx)
105+ }
106+
107+ /// Fetch the refmap, either by returning the existing one or invoking the command.
108+ #[ cfg( feature = "blocking-client" ) ]
109+ #[ allow( clippy:: result_large_err) ]
110+ pub fn fetch_blocking (
111+ self ,
112+ mut progress : impl Progress ,
113+ transport : & mut impl blocking_io:: Transport ,
114+ trace_packetlines : bool ,
115+ ) -> Result < crate :: fetch:: RefMap , crate :: fetch:: refmap:: init:: Error > {
116+ let ( cmd, cx) = match self {
117+ FetchRefMap :: Map ( map) => return Ok ( map) ,
118+ FetchRefMap :: Command ( cmd, cx) => ( cmd, cx) ,
119+ } ;
120+
121+ let capabilities = cmd. capabilities ;
122+ let remote_refs = cmd. invoke_blocking ( transport, & mut progress, trace_packetlines) ?;
104123 RefMap :: from_refs ( remote_refs, capabilities, cx)
105124 }
106125 }
0 commit comments