@@ -3,6 +3,7 @@ use crate::pack::receive::protocol::fetch::negotiate;
3
3
use crate :: OutputFormat ;
4
4
use gix:: config:: tree:: Key ;
5
5
use gix:: protocol:: maybe_async;
6
+ use gix:: remote:: fetch:: Error ;
6
7
use gix:: DynNestedProgress ;
7
8
pub use gix:: {
8
9
hash:: ObjectId ,
64
65
65
66
let agent = gix:: protocol:: agent ( gix:: env:: agent ( ) ) ;
66
67
let mut handshake = gix:: protocol:: fetch:: handshake (
67
- & mut transport,
68
+ & mut transport. inner ,
68
69
gix:: protocol:: credentials:: builtin,
69
70
vec ! [ ( "agent" . into( ) , Some ( agent. clone( ) ) ) ] ,
70
71
& mut progress,
@@ -85,13 +86,22 @@ where
85
86
& fetch_refspecs,
86
87
gix:: protocol:: fetch:: Context {
87
88
handshake : & mut handshake,
88
- transport : & mut transport,
89
+ transport : & mut transport. inner ,
89
90
user_agent : user_agent. clone ( ) ,
90
91
trace_packetlines,
91
92
} ,
92
93
gix:: protocol:: fetch:: refmap:: init:: Options :: default ( ) ,
93
94
)
94
95
. await ?;
96
+
97
+ if refmap. mappings . is_empty ( ) && !refmap. remote_refs . is_empty ( ) {
98
+ return Err ( Error :: NoMapping {
99
+ refspecs : refmap. refspecs . clone ( ) ,
100
+ num_remote_refs : refmap. remote_refs . len ( ) ,
101
+ }
102
+ . into ( ) ) ;
103
+ }
104
+
95
105
let mut negotiate = Negotiate { refmap : & refmap } ;
96
106
gix:: protocol:: fetch (
97
107
& mut negotiate,
@@ -114,7 +124,7 @@ where
114
124
& ctx. should_interrupt ,
115
125
gix:: protocol:: fetch:: Context {
116
126
handshake : & mut handshake,
117
- transport : & mut transport,
127
+ transport : & mut transport. inner ,
118
128
user_agent,
119
129
trace_packetlines,
120
130
} ,
@@ -140,10 +150,13 @@ impl gix::protocol::fetch::Negotiate for Negotiate<'_> {
140
150
} )
141
151
}
142
152
143
- fn add_wants ( & mut self , arguments : & mut Arguments , _remote_ref_target_known : & [ bool ] ) {
153
+ fn add_wants ( & mut self , arguments : & mut Arguments , _remote_ref_target_known : & [ bool ] ) -> bool {
154
+ let mut has_want = false ;
144
155
for id in self . refmap . mappings . iter ( ) . filter_map ( |m| m. remote . as_id ( ) ) {
145
156
arguments. want ( id) ;
157
+ has_want = true ;
146
158
}
159
+ has_want
147
160
}
148
161
149
162
fn one_round (
0 commit comments