History

[ref] rename Action::Close to Action::Cancel…

…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.

Sebastian Thiel committed 5 years ago

Commit cac1f6c1 parent 2ded7f95 files · +14 −16Browse files

Showing the changes to git-protocol/src/fetch/function.rs (1 of 5 files). Show all

Unified · Split

git-protocol/src/fetch/function.rs+3−3
@@ -144,7 +144,7 @@ where · 143 unmodified lines
144144 let next = delegate.prepare_fetch(protocol_version, &capabilities, &mut fetch_features, &parsed_refs);
145145 fetch.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &[], &fetch_features);
146146
147− if next == Action::Close {
147+ if next == Action::Cancel {
148148 transport.close().await?;
149149 return Ok(());
150150 }
@@ -159,7 +159,7 @@ where · 8 unmodified lines
159159 progress.set_name(format!("negotiate (round {})", round));
160160 round += 1;
161161 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?;
163163 if sideband_all {
164164 setup_remote_progress(&mut progress, &mut reader);
165165 }
@@ -174,7 +174,7 @@ where · 8 unmodified lines
174174 break 'negotiation;
175175 } else {
176176 match action {
177− Action::Close => break 'negotiation,
177+ Action::Cancel => break 'negotiation,
178178 Action::Continue => Some(response),
179179 }
180180 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t