summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-16 22:58:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 21:19:44 (GMT)
commit9fa2e5e8534519f07d1a93878fde6341fb012a6e (patch)
tree6ff8ea8871e472d28af494c21eb429bc37e866d7 /remote.c
parentf3acb8309f2ef229f9e1af3abe1ab9631e643fbc (diff)
downloadgit-9fa2e5e8534519f07d1a93878fde6341fb012a6e.zip
git-9fa2e5e8534519f07d1a93878fde6341fb012a6e.tar.gz
git-9fa2e5e8534519f07d1a93878fde6341fb012a6e.tar.bz2
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>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/remote.c b/remote.c
index 9eb79ea..84dda3f 100644
--- a/remote.c
+++ b/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,
- struct ref ***dst_tail, struct refspec_item *rs,
- int rs_nr)
+ struct ref ***dst_tail, struct refspec *rs)
{
int i, errs;
- for (i = errs = 0; i < rs_nr; i++)
- errs += match_explicit(src, dst, dst_tail, &rs[i]);
+ for (i = errs = 0; i < rs->nr; i++)
+ errs += match_explicit(src, dst, dst_tail, &rs->items[i]);
return errs;
}
@@ -1302,7 +1301,7 @@ int match_push_refs(struct ref *src, struct ref **dst,
refspec = default_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 */
for (ref = src; ref; ref = ref->next) {