Showing the changes to git-protocol/src/fetch/function.rs (1 of 14 files). Show all
Unified · Split
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | use crate::{ |
| 2 | 2 | credentials, |
| 3 | − fetch::{refs, Action, Arguments, Command, Delegate, Error, Response}, | |
| 3 | + fetch::{refs, Action, Arguments, Command, Delegate, Error, LsRefsAction, Response}, | |
| 4 | 4 | }; |
| 5 | 5 | use git_features::{progress, progress::Progress}; |
| 6 | 6 | use git_transport::{ |
| @@ -114,23 +114,28 @@ where · 107 unmodified lines | ||
| 114 | 114 | let ls_refs = Command::LsRefs; |
| 115 | 115 | let mut ls_features = ls_refs.default_features(protocol_version, &capabilities); |
| 116 | 116 | let mut ls_args = ls_refs.initial_arguments(&ls_features); |
| 117 | − delegate.prepare_ls_refs(&capabilities, &mut ls_args, &mut ls_features); | |
| 118 | − ls_refs.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &ls_args, &ls_features); | |
| 117 | + let next = delegate.prepare_ls_refs(&capabilities, &mut ls_args, &mut ls_features); | |
| 118 | + // User has requested to skip ls-refs, perhaps because they're using want-ref | |
| 119 | + if next == LsRefsAction::Skip { | |
| 120 | + vec![] | |
| 121 | + } else { | |
| 122 | + ls_refs.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &ls_args, &ls_features); | |
| 119 | 123 | |
| 120 | − progress.step(); | |
| 121 | − progress.set_name("list refs"); | |
| 122 | − let mut remote_refs = transport | |
| 123 | − .invoke( | |
| 124 | − ls_refs.as_str(), | |
| 125 | − ls_features.into_iter(), | |
| 126 | − if ls_args.is_empty() { | |
| 127 | − None | |
| 128 | − } else { | |
| 129 | − Some(ls_args.into_iter()) | |
| 130 | − }, | |
| 131 | − ) | |
| 132 | − .await?; | |
| 133 | − refs::from_v2_refs(&mut remote_refs).await? | |
| 124 | + progress.step(); | |
| 125 | + progress.set_name("list refs"); | |
| 126 | + let mut remote_refs = transport | |
| 127 | + .invoke( | |
| 128 | + ls_refs.as_str(), | |
| 129 | + ls_features.into_iter(), | |
| 130 | + if ls_args.is_empty() { | |
| 131 | + None | |
| 132 | + } else { | |
| 133 | + Some(ls_args.into_iter()) | |
| 134 | + }, | |
| 135 | + ) | |
| 136 | + .await?; | |
| 137 | + refs::from_v2_refs(&mut remote_refs).await? | |
| 138 | + } | |
| 134 | 139 | } |
| 135 | 140 | }; |
| 136 | 141 | |