@@ -62,15 +62,13 @@ pub(crate) mod function {
62
62
63
63
let ref_specs = remote. refspecs ( gix:: remote:: Direction :: Fetch ) ;
64
64
match res. status {
65
- Status :: NoPackReceived { update_refs } => {
66
- print_updates ( & repo, 1 , update_refs, ref_specs, res. ref_map , & mut out, err)
67
- }
68
- Status :: DryRun {
65
+ Status :: NoPackReceived {
69
66
update_refs,
70
- negotiation_rounds,
67
+ negotiate,
68
+ dry_run : _,
71
69
} => print_updates (
72
70
& repo,
73
- negotiation_rounds ,
71
+ negotiate . unwrap_or_default ( ) ,
74
72
update_refs,
75
73
ref_specs,
76
74
res. ref_map ,
@@ -80,17 +78,9 @@ pub(crate) mod function {
80
78
Status :: Change {
81
79
update_refs,
82
80
write_pack_bundle,
83
- negotiation_rounds ,
81
+ negotiate ,
84
82
} => {
85
- print_updates (
86
- & repo,
87
- negotiation_rounds,
88
- update_refs,
89
- ref_specs,
90
- res. ref_map ,
91
- & mut out,
92
- err,
93
- ) ?;
83
+ print_updates ( & repo, negotiate, update_refs, ref_specs, res. ref_map , & mut out, err) ?;
94
84
if let Some ( data_path) = write_pack_bundle. data_path {
95
85
writeln ! ( out, "pack file: \" {}\" " , data_path. display( ) ) . ok ( ) ;
96
86
}
@@ -108,7 +98,7 @@ pub(crate) mod function {
108
98
109
99
pub ( crate ) fn print_updates (
110
100
repo : & gix:: Repository ,
111
- negotiation_rounds : usize ,
101
+ negotiate : gix :: remote :: fetch :: outcome :: Negotiate ,
112
102
update_refs : gix:: remote:: fetch:: refs:: update:: Outcome ,
113
103
refspecs : & [ gix:: refspec:: RefSpec ] ,
114
104
mut map : gix:: remote:: fetch:: RefMap ,
@@ -212,8 +202,10 @@ pub(crate) mod function {
212
202
refspecs. len( )
213
203
) ?;
214
204
}
215
- if negotiation_rounds != 1 {
216
- writeln ! ( err, "needed {negotiation_rounds} rounds of pack-negotiation" ) ?;
205
+ match negotiate. rounds . len ( ) {
206
+ 0 => writeln ! ( err, "no negotiation was necessary" ) ?,
207
+ 1 => { }
208
+ rounds => writeln ! ( err, "needed {rounds} rounds of pack-negotiation" ) ?,
217
209
}
218
210
Ok ( ( ) )
219
211
}
0 commit comments