…in preparation to drop Transport::close() entirely. However, git::Connection actually wants to send a flush packet to inform the server about something and I have to check if that's really needed. Otherwise that has to go into a Drop impl, which forces more code duplication.
Showing the changes to git-protocol/src/fetch/function.rs (1 of 5 files). Show all
Unified · Split
| @@ -144,7 +144,7 @@ where · 143 unmodified lines | ||
| 144 | 144 | let next = delegate.prepare_fetch(protocol_version, &capabilities, &mut fetch_features, &parsed_refs); |
| 145 | 145 | fetch.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &[], &fetch_features); |
| 146 | 146 | |
| 147 | − if next == Action::Close { | |
| 147 | + if next == Action::Cancel { | |
| 148 | 148 | transport.close().await?; |
| 149 | 149 | return Ok(()); |
| 150 | 150 | } |
| @@ -159,7 +159,7 @@ where · 8 unmodified lines | ||
| 159 | 159 | progress.set_name(format!("negotiate (round {})", round)); |
| 160 | 160 | round += 1; |
| 161 | 161 | let action = delegate.negotiate(&parsed_refs, &mut arguments, previous_response.as_ref()); |
| 162 | − let mut reader = arguments.send(&mut transport, action == Action::Close).await?; | |
| 162 | + let mut reader = arguments.send(&mut transport, action == Action::Cancel).await?; | |
| 163 | 163 | if sideband_all { |
| 164 | 164 | setup_remote_progress(&mut progress, &mut reader); |
| 165 | 165 | } |
| @@ -174,7 +174,7 @@ where · 8 unmodified lines | ||
| 174 | 174 | break 'negotiation; |
| 175 | 175 | } else { |
| 176 | 176 | match action { |
| 177 | − Action::Close => break 'negotiation, | |
| 177 | + Action::Cancel => break 'negotiation, | |
| 178 | 178 | Action::Continue => Some(response), |
| 179 | 179 | } |
| 180 | 180 | } |