…to be called `previous_response` instead.
Showing the changes to git-protocol/src (1 of 4 files). Show all
Unified · Split
| @@ -81,10 +81,10 @@ pub trait DelegateBlocking { · 80 unmodified lines | ||
| 81 | 81 | |
| 82 | 82 | /// A method called repeatedly to negotiate the objects to receive in [`receive_pack(…)`][Delegate::receive_pack()]. |
| 83 | 83 | /// |
| 84 | − /// The first call has `previous` set to `None` as there was no previous response. Every call that follows `previous` | |
| 84 | + /// The first call has `previous_response` set to `None` as there was no previous response. Every call that follows `previous_response` | |
| 85 | 85 | /// will be set to `Some`. |
| 86 | 86 | /// |
| 87 | − /// ### If `previous` is `None`… | |
| 87 | + /// ### If `previous_response` is `None`… | |
| 88 | 88 | /// |
| 89 | 89 | /// Given a list of `arguments` to populate with wants, want-refs, shallows, filters and other contextual information to be |
| 90 | 90 | /// sent to the server. This method is called once. |
| @@ -97,17 +97,21 @@ pub trait DelegateBlocking { · 6 unmodified lines | ||
| 97 | 97 | /// Return `Action::Close` if you know that there are no `haves` on your end to allow the server to send all of its objects |
| 98 | 98 | /// as is the case during initial clones. |
| 99 | 99 | /// |
| 100 | − /// ### If `previous` is `Some`… | |
| 100 | + /// ### If `previous_response` is `Some`… | |
| 101 | 101 | /// |
| 102 | 102 | /// Populate `arguments` with the objects you `have` starting from the tips of _your_ refs, taking into consideration |
| 103 | − /// the `previous` response of the server to see which objects they acknowledged to have. You have to maintain | |
| 103 | + /// the `previous_response` response of the server to see which objects they acknowledged to have. You have to maintain | |
| 104 | 104 | /// enough state to be able to walk down from your tips on each call, if they are not in common, and keep setting `have` |
| 105 | 105 | /// for those which are in common if that helps teaching the server about our state and to acknowledge their existence on _their_ end. |
| 106 | 106 | /// This method is called until the other side signals they are ready to send a pack. |
| 107 | 107 | /// Return `Action::Close` if you want to give up before finding a common base. This can happen if the remote repository |
| 108 | 108 | /// has radically changed so there are no bases, or they are very far in the past, causing all objects to be sent. |
| 109 | − fn negotiate(&mut self, refs: &[Ref], arguments: &mut Arguments, previous: Option<&Response>) | |
| 110 | − -> io::Result<Action>; | |
| 109 | + fn negotiate( | |
| 110 | + &mut self, | |
| 111 | + refs: &[Ref], | |
| 112 | + arguments: &mut Arguments, | |
| 113 | + previous_response: Option<&Response>, | |
| 114 | + ) -> io::Result<Action>; | |
| 111 | 115 | |
| 112 | 116 | /// Return true if the server should be informed that the operation is completed and no further commands will be issued |
| 113 | 117 | /// at the end of the fetch operation. |
| @@ -151,9 +155,9 @@ impl<T: DelegateBlocking> DelegateBlocking for Box<T> { · 37 unmodified lines | ||
| 151 | 155 | &mut self, |
| 152 | 156 | refs: &[Ref], |
| 153 | 157 | arguments: &mut Arguments, |
| 154 | − previous: Option<&Response>, | |
| 158 | + previous_response: Option<&Response>, | |
| 155 | 159 | ) -> io::Result<Action> { |
| 156 | − self.deref_mut().negotiate(refs, arguments, previous) | |
| 160 | + self.deref_mut().negotiate(refs, arguments, previous_response) | |
| 157 | 161 | } |
| 158 | 162 | } |
| 159 | 163 | |
| @@ -185,9 +189,9 @@ impl<T: DelegateBlocking> DelegateBlocking for &mut T { · 25 unmodified lines | ||
| 185 | 189 | &mut self, |
| 186 | 190 | refs: &[Ref], |
| 187 | 191 | arguments: &mut Arguments, |
| 188 | − previous: Option<&Response>, | |
| 192 | + previous_response: Option<&Response>, | |
| 189 | 193 | ) -> io::Result<Action> { |
| 190 | − self.deref_mut().negotiate(refs, arguments, previous) | |
| 194 | + self.deref_mut().negotiate(refs, arguments, previous_response) | |
| 191 | 195 | } |
| 192 | 196 | } |
| 193 | 197 | |
| @@ -212,14 +216,14 @@ mod blocking_io { · 18 unmodified lines | ||
| 212 | 216 | /// |
| 213 | 217 | /// Use `progress` to emit your own progress messages when decoding the pack. |
| 214 | 218 | /// |
| 215 | − /// `refs` of the remote side are provided for convenience, along with the parsed `previous` response in case you want | |
| 219 | + /// `refs` of the remote side are provided for convenience, along with the parsed `previous_response` response in case you want | |
| 216 | 220 | /// to check additional acks. |
| 217 | 221 | fn receive_pack( |
| 218 | 222 | &mut self, |
| 219 | 223 | input: impl io::BufRead, |
| 220 | 224 | progress: impl Progress, |
| 221 | 225 | refs: &[Ref], |
| 222 | − previous: &Response, | |
| 226 | + previous_response: &Response, | |
| 223 | 227 | ) -> io::Result<()>; |
| 224 | 228 | } |
| 225 | 229 | |
| @@ -229,9 +233,9 @@ mod blocking_io { · 3 unmodified lines | ||
| 229 | 233 | input: impl BufRead, |
| 230 | 234 | progress: impl Progress, |
| 231 | 235 | refs: &[Ref], |
| 232 | − previous: &Response, | |
| 236 | + previous_response: &Response, | |
| 233 | 237 | ) -> io::Result<()> { |
| 234 | − self.deref_mut().receive_pack(input, progress, refs, previous) | |
| 238 | + self.deref_mut().receive_pack(input, progress, refs, previous_response) | |
| 235 | 239 | } |
| 236 | 240 | } |
| 237 | 241 | |
| @@ -241,9 +245,9 @@ mod blocking_io { · 3 unmodified lines | ||
| 241 | 245 | input: impl BufRead, |
| 242 | 246 | progress: impl Progress, |
| 243 | 247 | refs: &[Ref], |
| 244 | − previous: &Response, | |
| 248 | + previous_response: &Response, | |
| 245 | 249 | ) -> io::Result<()> { |
| 246 | − self.deref_mut().receive_pack(input, progress, refs, previous) | |
| 250 | + self.deref_mut().receive_pack(input, progress, refs, previous_response) | |
| 247 | 251 | } |
| 248 | 252 | } |
| 249 | 253 | } |
| @@ -272,14 +276,14 @@ mod async_io { · 22 unmodified lines | ||
| 272 | 276 | /// |
| 273 | 277 | /// Use `progress` to emit your own progress messages when decoding the pack. |
| 274 | 278 | /// |
| 275 | − /// `refs` of the remote side are provided for convenience, along with the parsed `previous` response in case you want | |
| 279 | + /// `refs` of the remote side are provided for convenience, along with the parsed `previous_response` response in case you want | |
| 276 | 280 | /// to check additional acks. |
| 277 | 281 | async fn receive_pack( |
| 278 | 282 | &mut self, |
| 279 | 283 | input: impl AsyncBufRead + Unpin + 'async_trait, |
| 280 | 284 | progress: impl Progress, |
| 281 | 285 | refs: &[Ref], |
| 282 | − previous: &Response, | |
| 286 | + previous_response: &Response, | |
| 283 | 287 | ) -> io::Result<()>; |
| 284 | 288 | } |
| 285 | 289 | #[async_trait(?Send)] |
| @@ -289,9 +293,11 @@ mod async_io { · 3 unmodified lines | ||
| 289 | 293 | input: impl AsyncBufRead + Unpin + 'async_trait, |
| 290 | 294 | progress: impl Progress, |
| 291 | 295 | refs: &[Ref], |
| 292 | − previous: &Response, | |
| 296 | + previous_response: &Response, | |
| 293 | 297 | ) -> io::Result<()> { |
| 294 | − self.deref_mut().receive_pack(input, progress, refs, previous).await | |
| 298 | + self.deref_mut() | |
| 299 | + .receive_pack(input, progress, refs, previous_response) | |
| 300 | + .await | |
| 295 | 301 | } |
| 296 | 302 | } |
| 297 | 303 | |
| @@ -302,9 +308,11 @@ mod async_io { · 4 unmodified lines | ||
| 302 | 308 | input: impl AsyncBufRead + Unpin + 'async_trait, |
| 303 | 309 | progress: impl Progress, |
| 304 | 310 | refs: &[Ref], |
| 305 | − previous: &Response, | |
| 311 | + previous_response: &Response, | |
| 306 | 312 | ) -> io::Result<()> { |
| 307 | − self.deref_mut().receive_pack(input, progress, refs, previous).await | |
| 313 | + self.deref_mut() | |
| 314 | + .receive_pack(input, progress, refs, previous_response) | |
| 315 | + .await | |
| 308 | 316 | } |
| 309 | 317 | } |
| 310 | 318 | } |