remote: convert match_explicit_refs to take a struct refspec
Convert 'match_explicit_refs()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams committed
May 16, 2018 at 15:58 UTC
9fa2e5e8534519f07d1a93878fde6341fb012a6e
1 file changed
+4
-5
remote.c
+4
-5
@@ -1073,12 +1073,11 @@ static int match_explicit(struct ref *src, struct ref *dst,
1073
}
1074
1075
static int match_explicit_refs(struct ref *src, struct ref *dst,
1076
- struct ref ***dst_tail, struct refspec_item *rs,
1077
- int rs_nr)
1076
+ struct ref ***dst_tail, struct refspec *rs)
1077
{
1078
int i, errs;
1080
- for (i = errs = 0; i < rs_nr; i++)
1081
- errs += match_explicit(src, dst, dst_tail, &rs[i]);
1079
+ for (i = errs = 0; i < rs->nr; i++)
1080
+ errs += match_explicit(src, dst, dst_tail, &rs->items[i]);
1081
return errs;
1082
}
1083
@@ -1302,7 +1301,7 @@ int match_push_refs(struct ref *src, struct ref **dst,
1301
refspec = default_refspec;
1302
}
1303
refspec_appendn(&rs, refspec, nr_refspec);
1305
- errs = match_explicit_refs(src, *dst, &dst_tail, rs.items, rs.nr);
1304
+ errs = match_explicit_refs(src, *dst, &dst_tail, &rs);
1305
1306
/* pick the remainder */
1307
for (ref = src; ref; ref = ref->next) {