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>maint
parent
f3acb8309f
commit
9fa2e5e853
9
remote.c
9
remote.c
|
|
@ -1073,12 +1073,11 @@ static int match_explicit(struct ref *src, struct ref *dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int match_explicit_refs(struct ref *src, struct ref *dst,
|
static int match_explicit_refs(struct ref *src, struct ref *dst,
|
||||||
struct ref ***dst_tail, struct refspec_item *rs,
|
struct ref ***dst_tail, struct refspec *rs)
|
||||||
int rs_nr)
|
|
||||||
{
|
{
|
||||||
int i, errs;
|
int i, errs;
|
||||||
for (i = errs = 0; i < rs_nr; i++)
|
for (i = errs = 0; i < rs->nr; i++)
|
||||||
errs += match_explicit(src, dst, dst_tail, &rs[i]);
|
errs += match_explicit(src, dst, dst_tail, &rs->items[i]);
|
||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1302,7 +1301,7 @@ int match_push_refs(struct ref *src, struct ref **dst,
|
||||||
refspec = default_refspec;
|
refspec = default_refspec;
|
||||||
}
|
}
|
||||||
refspec_appendn(&rs, refspec, nr_refspec);
|
refspec_appendn(&rs, refspec, nr_refspec);
|
||||||
errs = match_explicit_refs(src, *dst, &dst_tail, rs.items, rs.nr);
|
errs = match_explicit_refs(src, *dst, &dst_tail, &rs);
|
||||||
|
|
||||||
/* pick the remainder */
|
/* pick the remainder */
|
||||||
for (ref = src; ref; ref = ref->next) {
|
for (ref = src; ref; ref = ref->next) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue