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
144 let next = delegate.prepare_fetch(protocol_version, &capabilities, &mut fetch_features, &parsed_refs);144 let next = delegate.prepare_fetch(protocol_version, &capabilities, &mut fetch_features, &parsed_refs);
145 fetch.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &[], &fetch_features);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 transport.close().await?;148 transport.close().await?;
149 return Ok(());149 return Ok(());
150 }150 }
@@ -159,7 +159,7 @@ where · 8 unmodified lines
159 progress.set_name(format!("negotiate (round {})", round));159 progress.set_name(format!("negotiate (round {})", round));
160 round += 1;160 round += 1;
161 let action = delegate.negotiate(&parsed_refs, &mut arguments, previous_response.as_ref());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 if sideband_all {163 if sideband_all {
164 setup_remote_progress(&mut progress, &mut reader);164 setup_remote_progress(&mut progress, &mut reader);
165 }165 }
@@ -174,7 +174,7 @@ where · 8 unmodified lines
174 break 'negotiation;174 break 'negotiation;
175 } else {175 } else {
176 match action {176 match action {
177 Action::Close => break 'negotiation,177 Action::Cancel => break 'negotiation,
178 Action::Continue => Some(response),178 Action::Continue => Some(response),
179 }179 }
180 }180 }

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