Showing the changes to git-protocol/src/fetch/function.rs (1 of 7 files). Show all
Unified · Split
| @@ -19,14 +19,15 @@ use std::io; · 18 unmodified lines | ||
| 19 | 19 | /// |
| 20 | 20 | /// _Note_ that depending on the `delegate`, the actual action performed can be `ls-refs`, `clone` or `fetch`. |
| 21 | 21 | #[maybe_async] |
| 22 | −pub async fn fetch<F>( | |
| 22 | +pub async fn fetch<F, D>( | |
| 23 | 23 | mut transport: impl client::Transport, |
| 24 | − delegate: &mut impl Delegate, | |
| 24 | + mut delegate: D, | |
| 25 | 25 | mut authenticate: F, |
| 26 | 26 | mut progress: impl Progress, |
| 27 | −) -> Result<(), Error> | |
| 27 | +) -> Result<D, Error> | |
| 28 | 28 | where |
| 29 | 29 | F: FnMut(credentials::Action<'_>) -> credentials::Result, |
| 30 | + D: Delegate + Send + 'static, | |
| 30 | 31 | { |
| 31 | 32 | let (protocol_version, mut parsed_refs, capabilities, call_ls_refs) = { |
| 32 | 33 | progress.init(None, progress::steps()); |
| @@ -134,7 +135,7 @@ where · 101 unmodified lines | ||
| 134 | 135 | |
| 135 | 136 | if next == Action::Close { |
| 136 | 137 | transport.close().await?; |
| 137 | − return Ok(()); | |
| 138 | + return Ok(delegate); | |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | 141 | Response::check_required_features(protocol_version, &fetch_features)?; |
| @@ -167,7 +168,7 @@ where · 26 unmodified lines | ||
| 167 | 168 | } |
| 168 | 169 | } |
| 169 | 170 | } |
| 170 | − Ok(()) | |
| 171 | + Ok(delegate) | |
| 171 | 172 | } |
| 172 | 173 | |
| 173 | 174 | fn setup_remote_progress( |