925
return ref_map;
926
}
927
928
-static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query)
928
+static int refspec_find_negative_match(struct refspec *rs, struct refspec_item *query)
929
{
930
int i, matched_negative = 0;
931
int find_src = !query->src;
982
return matched_negative;
983
}
984
985
-static void query_refspecs_multiple(struct refspec *rs,
985
+static void refspec_find_all_matches(struct refspec *rs,
986
struct refspec_item *query,
987
struct string_list *results)
988
{
990
int find_src = !query->src;
991
992
if (find_src && !query->dst)
993
- BUG("query_refspecs_multiple: need either src or dst");
993
+ BUG("refspec_find_all_matches: need either src or dst");
994
995
- if (query_matches_negative_refspec(rs, query))
995
+ if (refspec_find_negative_match(rs, query))
996
return;
997
998
for (i = 0; i < rs->nr; i++) {
1013
}
1014
}
1015
1016
-int query_refspecs(struct refspec *rs, struct refspec_item *query)
1016
+int refspec_find_match(struct refspec *rs, struct refspec_item *query)
1017
{
1018
int i;
1019
int find_src = !query->src;
1021
char **result = find_src ? &query->src : &query->dst;
1022
1023
if (find_src && !query->dst)
1024
- BUG("query_refspecs: need either src or dst");
1024
+ BUG("refspec_find_match: need either src or dst");
1025
1026
- if (query_matches_negative_refspec(rs, query))
1026
+ if (refspec_find_negative_match(rs, query))
1027
return -1;
1028
1029
for (i = 0; i < rs->nr; i++) {
1054
memset(&query, 0, sizeof(struct refspec_item));
1055
query.src = (char *)name;
1056
1057
- if (query_refspecs(rs, &query))
1057
+ if (refspec_find_match(rs, &query))
1058
return NULL;
1059
1060
return query.dst;
1062
1063
int remote_find_tracking(struct remote *remote, struct refspec_item *refspec)
1064
{
1065
- return query_refspecs(&remote->fetch, refspec);
1065
+ return refspec_find_match(&remote->fetch, refspec);
1066
}
1067
1068
static struct ref *alloc_ref_with_prefix(const char *prefix, size_t prefixlen,
2487
memset(&query, 0, sizeof(struct refspec_item));
2488
query.dst = (char *)refname;
2489
2490
- query_refspecs_multiple(info->rs, &query, &matches);
2490
+ refspec_find_all_matches(info->rs, &query, &matches);
2491
if (matches.nr == 0)
2492
goto clean_exit; /* No matches */
2493