Showing the changes to git-protocol/src/fetch/function.rs (1 of 14 files). Show all
Unified · Split
| @@ -1,6 +1,6 @@ | |||
| 1 | use crate::{ | 1 | use crate::{ |
| 2 | credentials, | 2 | credentials, |
| 3 | fetch::{refs, Action, Arguments, Command, Delegate, Error, Response}, | 3 | fetch::{refs, Action, Arguments, Command, Delegate, Error, LsRefsAction, Response}, |
| 4 | }; | 4 | }; |
| 5 | use git_features::{progress, progress::Progress}; | 5 | use git_features::{progress, progress::Progress}; |
| 6 | use git_transport::{ | 6 | use git_transport::{ |
| @@ -114,23 +114,28 @@ where · 107 unmodified lines | |||
| 114 | let ls_refs = Command::LsRefs; | 114 | let ls_refs = Command::LsRefs; |
| 115 | let mut ls_features = ls_refs.default_features(protocol_version, &capabilities); | 115 | let mut ls_features = ls_refs.default_features(protocol_version, &capabilities); |
| 116 | let mut ls_args = ls_refs.initial_arguments(&ls_features); | 116 | let mut ls_args = ls_refs.initial_arguments(&ls_features); |
| 117 | delegate.prepare_ls_refs(&capabilities, &mut ls_args, &mut ls_features); | 117 | let next = 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); | 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(); | 124 | progress.step(); |
| 121 | progress.set_name("list refs"); | 125 | progress.set_name("list refs"); |
| 122 | let mut remote_refs = transport | 126 | let mut remote_refs = transport |
| 123 | .invoke( | 127 | .invoke( |
| 124 | ls_refs.as_str(), | 128 | ls_refs.as_str(), |
| 125 | ls_features.into_iter(), | 129 | ls_features.into_iter(), |
| 126 | if ls_args.is_empty() { | 130 | if ls_args.is_empty() { |
| 127 | None | 131 | None |
| 128 | } else { | 132 | } else { |
| 129 | Some(ls_args.into_iter()) | 133 | Some(ls_args.into_iter()) |
| 130 | }, | 134 | }, |
| 131 | ) | 135 | ) |
| 132 | .await?; | 136 | .await?; |
| 133 | refs::from_v2_refs(&mut remote_refs).await? | 137 | refs::from_v2_refs(&mut remote_refs).await? |
| 138 | } | ||
| 134 | } | 139 | } |
| 135 | }; | 140 | }; |
| 136 | 141 | ||