|
1 | | -use std::{borrow::Cow, collections::HashSet}; |
| 1 | +use std::borrow::Cow; |
2 | 2 |
|
3 | | -use bstr::{BString, ByteSlice, ByteVec}; |
| 3 | +use bstr::{BString, ByteSlice}; |
4 | 4 | use gix_features::progress::Progress; |
5 | 5 | use gix_transport::client::Capabilities; |
6 | 6 |
|
@@ -79,7 +79,7 @@ impl RefMap { |
79 | 79 | let all_refspecs = context.aggregate_refspecs(); |
80 | 80 | let mut refs_cmd = crate::LsRefsCommand::new(capabilities, user_agent); |
81 | 81 | if prefix_from_spec_as_filter_on_remote { |
82 | | - push_prefix_arguments(&all_refspecs, refs_cmd.arguments()); |
| 82 | + refs_cmd.push_prefix_arguments(&all_refspecs); |
83 | 83 | } |
84 | 84 |
|
85 | 85 | let remote_refs = refs_cmd.invoke(transport, &mut progress, trace_packetlines).await?; |
@@ -154,18 +154,3 @@ impl RefMap { |
154 | 154 | }) |
155 | 155 | } |
156 | 156 | } |
157 | | - |
158 | | -fn push_prefix_arguments(all_refspecs: &[gix_refspec::RefSpec], arguments: &mut Vec<BString>) { |
159 | | - let mut seen = HashSet::new(); |
160 | | - for spec in all_refspecs { |
161 | | - let spec = spec.to_ref(); |
162 | | - if seen.insert(spec.instruction()) { |
163 | | - let mut prefixes = Vec::with_capacity(1); |
164 | | - spec.expand_prefixes(&mut prefixes); |
165 | | - for mut prefix in prefixes { |
166 | | - prefix.insert_str(0, "ref-prefix "); |
167 | | - arguments.push(prefix); |
168 | | - } |
169 | | - } |
170 | | - } |
171 | | -} |
0 commit comments