@@ -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 ;
@@ -89,12 +89,12 @@ pub(crate) mod hero {
8989
9090 impl FetchRefMap < ' _ > {
9191 /// Fetch the refmap, either by returning the existing one or invoking the command.
92+ #[ cfg( feature = "async-client" ) ]
9293 #[ allow( clippy:: result_large_err) ]
93- #[ maybe_async:: maybe_async]
94- pub async fn fetch (
94+ pub async fn fetch_async (
9595 self ,
9696 mut progress : impl Progress ,
97- transport : & mut impl Transport ,
97+ transport : & mut impl async_io :: Transport ,
9898 trace_packetlines : bool ,
9999 ) -> Result < crate :: fetch:: RefMap , crate :: fetch:: refmap:: init:: Error > {
100100 let ( cmd, cx) = match self {
@@ -103,7 +103,26 @@ pub(crate) mod hero {
103103 } ;
104104
105105 let capabilities = cmd. capabilities ;
106- let remote_refs = cmd. invoke ( transport, & mut progress, trace_packetlines) . await ?;
106+ let remote_refs = cmd. invoke_async ( transport, & mut progress, trace_packetlines) . await ?;
107+ RefMap :: from_refs ( remote_refs, capabilities, cx)
108+ }
109+
110+ /// Fetch the refmap, either by returning the existing one or invoking the command.
111+ #[ cfg( feature = "blocking-client" ) ]
112+ #[ allow( clippy:: result_large_err) ]
113+ pub fn fetch_blocking (
114+ self ,
115+ mut progress : impl Progress ,
116+ transport : & mut impl blocking_io:: Transport ,
117+ trace_packetlines : bool ,
118+ ) -> Result < crate :: fetch:: RefMap , crate :: fetch:: refmap:: init:: Error > {
119+ let ( cmd, cx) = match self {
120+ FetchRefMap :: Map ( map) => return Ok ( map) ,
121+ FetchRefMap :: Command ( cmd, cx) => ( cmd, cx) ,
122+ } ;
123+
124+ let capabilities = cmd. capabilities ;
125+ let remote_refs = cmd. invoke_blocking ( transport, & mut progress, trace_packetlines) ?;
107126 RefMap :: from_refs ( remote_refs, capabilities, cx)
108127 }
109128 }
0 commit comments