@@ -698,16 +698,18 @@ static int match_name_with_pattern(const char *key, const char *name,
698
698
return ret ;
699
699
}
700
700
701
- static void query_refspecs_multiple (struct refspec_item * refs , int ref_count , struct refspec_item * query , struct string_list * results )
701
+ static void query_refspecs_multiple (struct refspec * rs ,
702
+ struct refspec_item * query ,
703
+ struct string_list * results )
702
704
{
703
705
int i ;
704
706
int find_src = !query -> src ;
705
707
706
708
if (find_src && !query -> dst )
707
709
error ("query_refspecs_multiple: need either src or dst" );
708
710
709
- for (i = 0 ; i < ref_count ; i ++ ) {
710
- struct refspec_item * refspec = & refs [i ];
711
+ for (i = 0 ; i < rs -> nr ; i ++ ) {
712
+ struct refspec_item * refspec = & rs -> items [i ];
711
713
const char * key = find_src ? refspec -> dst : refspec -> src ;
712
714
const char * value = find_src ? refspec -> src : refspec -> dst ;
713
715
const char * needle = find_src ? query -> dst : query -> src ;
@@ -2068,8 +2070,7 @@ struct ref *guess_remote_head(const struct ref *head,
2068
2070
struct stale_heads_info {
2069
2071
struct string_list * ref_names ;
2070
2072
struct ref * * stale_refs_tail ;
2071
- struct refspec_item * refs ;
2072
- int ref_count ;
2073
+ struct refspec * rs ;
2073
2074
};
2074
2075
2075
2076
static int get_stale_heads_cb (const char * refname , const struct object_id * oid ,
@@ -2082,7 +2083,7 @@ static int get_stale_heads_cb(const char *refname, const struct object_id *oid,
2082
2083
memset (& query , 0 , sizeof (struct refspec_item ));
2083
2084
query .dst = (char * )refname ;
2084
2085
2085
- query_refspecs_multiple (info -> refs , info -> ref_count , & query , & matches );
2086
+ query_refspecs_multiple (info -> rs , & query , & matches );
2086
2087
if (matches .nr == 0 )
2087
2088
goto clean_exit ; /* No matches */
2088
2089
@@ -2110,16 +2111,15 @@ static int get_stale_heads_cb(const char *refname, const struct object_id *oid,
2110
2111
return 0 ;
2111
2112
}
2112
2113
2113
- struct ref * get_stale_heads (struct refspec_item * refs , int ref_count , struct ref * fetch_map )
2114
+ struct ref * get_stale_heads (struct refspec * rs , struct ref * fetch_map )
2114
2115
{
2115
2116
struct ref * ref , * stale_refs = NULL ;
2116
2117
struct string_list ref_names = STRING_LIST_INIT_NODUP ;
2117
2118
struct stale_heads_info info ;
2118
2119
2119
2120
info .ref_names = & ref_names ;
2120
2121
info .stale_refs_tail = & stale_refs ;
2121
- info .refs = refs ;
2122
- info .ref_count = ref_count ;
2122
+ info .rs = rs ;
2123
2123
for (ref = fetch_map ; ref ; ref = ref -> next )
2124
2124
string_list_append (& ref_names , ref -> name );
2125
2125
string_list_sort (& ref_names );
0 commit comments