Skip to content

Commit 0f58b01

Browse files
committed
protocol: extract condition from helper function
1 parent 3b4e06a commit 0f58b01

File tree

1 file changed

+4
-14
lines changed
  • gix-protocol/src/fetch/refmap

1 file changed

+4
-14
lines changed

gix-protocol/src/fetch/refmap/init.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ impl RefMap {
7878
let _span = gix_trace::coarse!("gix_protocol::fetch::RefMap::new()");
7979
let all_refspecs = context.aggregate_refspecs();
8080
let mut refs_cmd = crate::LsRefsCommand::new(capabilities, user_agent);
81-
push_prefix_arguments(
82-
prefix_from_spec_as_filter_on_remote,
83-
&all_refspecs,
84-
refs_cmd.arguments(),
85-
);
81+
if prefix_from_spec_as_filter_on_remote {
82+
push_prefix_arguments(&all_refspecs, refs_cmd.arguments());
83+
}
8684

8785
let remote_refs = refs_cmd.invoke(transport, &mut progress, trace_packetlines).await?;
8886
Self::from_refs(remote_refs, capabilities, context)
@@ -157,15 +155,7 @@ impl RefMap {
157155
}
158156
}
159157

160-
fn push_prefix_arguments(
161-
prefix_from_spec_as_filter_on_remote: bool,
162-
all_refspecs: &[gix_refspec::RefSpec],
163-
arguments: &mut Vec<BString>,
164-
) {
165-
if !prefix_from_spec_as_filter_on_remote {
166-
return;
167-
}
168-
158+
fn push_prefix_arguments(all_refspecs: &[gix_refspec::RefSpec], arguments: &mut Vec<BString>) {
169159
let mut seen = HashSet::new();
170160
for spec in all_refspecs {
171161
let spec = spec.to_ref();

0 commit comments

Comments
 (0)