@@ -4,6 +4,7 @@ use std::{
44 sync:: { atomic:: AtomicBool , Arc } ,
55} ;
66
7+ use crate :: { net, pack:: receive:: protocol:: fetch:: negotiate, OutputFormat } ;
78#[ cfg( feature = "async-client" ) ]
89use gix:: protocol:: transport:: client:: async_io:: connect;
910#[ cfg( feature = "blocking-client" ) ]
@@ -23,8 +24,6 @@ pub use gix::{
2324 NestedProgress , Progress ,
2425} ;
2526
26- use crate :: { net, pack:: receive:: protocol:: fetch:: negotiate, OutputFormat } ;
27-
2827pub const PROGRESS_RANGE : std:: ops:: RangeInclusive < u8 > = 1 ..=3 ;
2928pub struct Context < W > {
3029 pub thread_limit : Option < usize > ,
6564 . is_some ( ) ;
6665
6766 let agent = gix:: protocol:: agent ( gix:: env:: agent ( ) ) ;
68- let mut handshake = gix:: protocol:: fetch:: handshake (
67+ let mut handshake: gix :: protocol :: Handshake = gix:: protocol:: fetch:: handshake (
6968 & mut transport. inner ,
7069 gix:: protocol:: credentials:: builtin,
7170 vec ! [ ( "agent" . into( ) , Some ( agent. clone( ) ) ) ] ,
@@ -87,21 +86,16 @@ where
8786 fetch_refspecs : fetch_refspecs. clone ( ) ,
8887 extra_refspecs : vec ! [ ] ,
8988 } ;
90- let refmap = match handshake. refs . take ( ) {
91- Some ( refs) => gix:: protocol:: fetch:: RefMap :: from_refs ( refs, & handshake. capabilities , context) ?,
92- None => {
93- gix:: protocol:: fetch:: RefMap :: fetch (
94- & mut progress,
95- & handshake. capabilities ,
96- & mut transport. inner ,
97- user_agent. clone ( ) ,
98- trace_packetlines,
99- true ,
100- context,
101- )
102- . await ?
103- }
104- } ;
89+ let refmap = handshake
90+ . fetch_or_extract_refmap (
91+ & mut progress,
92+ & mut transport. inner ,
93+ user_agent. clone ( ) ,
94+ trace_packetlines,
95+ true ,
96+ context,
97+ )
98+ . await ?;
10599
106100 if refmap. mappings . is_empty ( ) && !refmap. remote_refs . is_empty ( ) {
107101 return Err ( Error :: NoMapping {
0 commit comments