@@ -1157,7 +1157,7 @@ int match_push_refs(struct ref *src, struct ref **dst,
1157
1157
int send_mirror = flags & MATCH_REFS_MIRROR ;
1158
1158
int errs ;
1159
1159
static const char * default_refspec [] = { ":" , NULL };
1160
- struct ref * * dst_tail = tail_ref (dst );
1160
+ struct ref * ref , * * dst_tail = tail_ref (dst );
1161
1161
1162
1162
if (!nr_refspec ) {
1163
1163
nr_refspec = 1 ;
@@ -1167,14 +1167,14 @@ int match_push_refs(struct ref *src, struct ref **dst,
1167
1167
errs = match_explicit_refs (src , * dst , & dst_tail , rs , nr_refspec );
1168
1168
1169
1169
/* pick the remainder */
1170
- for ( ; src ; src = src -> next ) {
1170
+ for (ref = src ; ref ; ref = ref -> next ) {
1171
1171
struct ref * dst_peer ;
1172
1172
const struct refspec * pat = NULL ;
1173
1173
char * dst_name ;
1174
- if (src -> peer_ref )
1174
+ if (ref -> peer_ref )
1175
1175
continue ;
1176
1176
1177
- pat = check_pattern_match (rs , nr_refspec , src );
1177
+ pat = check_pattern_match (rs , nr_refspec , ref );
1178
1178
if (!pat )
1179
1179
continue ;
1180
1180
@@ -1184,13 +1184,14 @@ int match_push_refs(struct ref *src, struct ref **dst,
1184
1184
* including refs outside refs/heads/ hierarchy, but
1185
1185
* that does not make much sense these days.
1186
1186
*/
1187
- if (!send_mirror && prefixcmp (src -> name , "refs/heads/" ))
1187
+ if (!send_mirror && prefixcmp (ref -> name , "refs/heads/" ))
1188
1188
continue ;
1189
- dst_name = xstrdup (src -> name );
1189
+ dst_name = xstrdup (ref -> name );
1190
+
1190
1191
1191
1192
} else {
1192
1193
const char * dst_side = pat -> dst ? pat -> dst : pat -> src ;
1193
- if (!match_name_with_pattern (pat -> src , src -> name ,
1194
+ if (!match_name_with_pattern (pat -> src , ref -> name ,
1194
1195
dst_side , & dst_name ))
1195
1196
die ("Didn't think it matches any more" );
1196
1197
}
@@ -1211,9 +1212,9 @@ int match_push_refs(struct ref *src, struct ref **dst,
1211
1212
1212
1213
/* Create a new one and link it */
1213
1214
dst_peer = make_linked_ref (dst_name , & dst_tail );
1214
- hashcpy (dst_peer -> new_sha1 , src -> new_sha1 );
1215
+ hashcpy (dst_peer -> new_sha1 , ref -> new_sha1 );
1215
1216
}
1216
- dst_peer -> peer_ref = copy_ref (src );
1217
+ dst_peer -> peer_ref = copy_ref (ref );
1217
1218
dst_peer -> force = pat -> force ;
1218
1219
free_name :
1219
1220
free (dst_name );
0 commit comments