@@ -1082,27 +1082,29 @@ static int match_explicit_refs(struct ref *src, struct ref *dst,
1082
1082
return errs ;
1083
1083
}
1084
1084
1085
- static char * get_ref_match (const struct refspec_item * rs , int rs_nr , const struct ref * ref ,
1086
- int send_mirror , int direction , const struct refspec_item * * ret_pat )
1085
+ static char * get_ref_match (const struct refspec * rs , const struct ref * ref ,
1086
+ int send_mirror , int direction ,
1087
+ const struct refspec_item * * ret_pat )
1087
1088
{
1088
1089
const struct refspec_item * pat ;
1089
1090
char * name ;
1090
1091
int i ;
1091
1092
int matching_refs = -1 ;
1092
- for (i = 0 ; i < rs_nr ; i ++ ) {
1093
- if (rs [i ].matching &&
1094
- (matching_refs == -1 || rs [i ].force )) {
1093
+ for (i = 0 ; i < rs -> nr ; i ++ ) {
1094
+ const struct refspec_item * item = & rs -> items [i ];
1095
+ if (item -> matching &&
1096
+ (matching_refs == -1 || item -> force )) {
1095
1097
matching_refs = i ;
1096
1098
continue ;
1097
1099
}
1098
1100
1099
- if (rs [ i ]. pattern ) {
1100
- const char * dst_side = rs [ i ]. dst ? rs [ i ]. dst : rs [ i ]. src ;
1101
+ if (item -> pattern ) {
1102
+ const char * dst_side = item -> dst ? item -> dst : item -> src ;
1101
1103
int match ;
1102
1104
if (direction == FROM_SRC )
1103
- match = match_name_with_pattern (rs [ i ]. src , ref -> name , dst_side , & name );
1105
+ match = match_name_with_pattern (item -> src , ref -> name , dst_side , & name );
1104
1106
else
1105
- match = match_name_with_pattern (dst_side , ref -> name , rs [ i ]. src , & name );
1107
+ match = match_name_with_pattern (dst_side , ref -> name , item -> src , & name );
1106
1108
if (match ) {
1107
1109
matching_refs = i ;
1108
1110
break ;
@@ -1112,7 +1114,7 @@ static char *get_ref_match(const struct refspec_item *rs, int rs_nr, const struc
1112
1114
if (matching_refs == -1 )
1113
1115
return NULL ;
1114
1116
1115
- pat = rs + matching_refs ;
1117
+ pat = & rs -> items [ matching_refs ] ;
1116
1118
if (pat -> matching ) {
1117
1119
/*
1118
1120
* "matching refs"; traditionally we pushed everything
@@ -1309,7 +1311,7 @@ int match_push_refs(struct ref *src, struct ref **dst,
1309
1311
const struct refspec_item * pat = NULL ;
1310
1312
char * dst_name ;
1311
1313
1312
- dst_name = get_ref_match (rs . items , rs . nr , ref , send_mirror , FROM_SRC , & pat );
1314
+ dst_name = get_ref_match (& rs , ref , send_mirror , FROM_SRC , & pat );
1313
1315
if (!dst_name )
1314
1316
continue ;
1315
1317
@@ -1358,7 +1360,7 @@ int match_push_refs(struct ref *src, struct ref **dst,
1358
1360
/* We're already sending something to this ref. */
1359
1361
continue ;
1360
1362
1361
- src_name = get_ref_match (rs . items , rs . nr , ref , send_mirror , FROM_DST , NULL );
1363
+ src_name = get_ref_match (& rs , ref , send_mirror , FROM_DST , NULL );
1362
1364
if (src_name ) {
1363
1365
if (!src_ref_index .nr )
1364
1366
prepare_ref_index (& src_ref_index , src );
0 commit comments