@@ -1093,11 +1093,11 @@ static int run_pre_push_hook(struct transport *transport,
1093
1093
}
1094
1094
1095
1095
int transport_push (struct transport * transport ,
1096
- int refspec_nr , const char * * refspec , int flags ,
1096
+ struct refspec * rs , int flags ,
1097
1097
unsigned int * reject_reasons )
1098
1098
{
1099
1099
* reject_reasons = 0 ;
1100
- transport_verify_remote_names (refspec_nr , refspec );
1100
+ transport_verify_remote_names (rs -> raw_nr , rs -> raw );
1101
1101
1102
1102
if (transport_color_config () < 0 )
1103
1103
return -1 ;
@@ -1111,16 +1111,14 @@ int transport_push(struct transport *transport,
1111
1111
int porcelain = flags & TRANSPORT_PUSH_PORCELAIN ;
1112
1112
int pretend = flags & TRANSPORT_PUSH_DRY_RUN ;
1113
1113
int push_ret , ret , err ;
1114
- struct refspec tmp_rs = REFSPEC_INIT_PUSH ;
1115
1114
struct argv_array ref_prefixes = ARGV_ARRAY_INIT ;
1116
1115
int i ;
1117
1116
1118
- if (check_push_refs (local_refs , refspec_nr , refspec ) < 0 )
1117
+ if (check_push_refs (local_refs , rs -> raw_nr , rs -> raw ) < 0 )
1119
1118
return -1 ;
1120
1119
1121
- refspec_appendn (& tmp_rs , refspec , refspec_nr );
1122
- for (i = 0 ; i < tmp_rs .nr ; i ++ ) {
1123
- const struct refspec_item * item = & tmp_rs .items [i ];
1120
+ for (i = 0 ; i < rs -> nr ; i ++ ) {
1121
+ const struct refspec_item * item = & rs -> items [i ];
1124
1122
const char * prefix = NULL ;
1125
1123
1126
1124
if (item -> dst )
@@ -1143,7 +1141,6 @@ int transport_push(struct transport *transport,
1143
1141
& ref_prefixes );
1144
1142
1145
1143
argv_array_clear (& ref_prefixes );
1146
- refspec_clear (& tmp_rs );
1147
1144
1148
1145
if (flags & TRANSPORT_PUSH_ALL )
1149
1146
match_flags |= MATCH_REFS_ALL ;
@@ -1155,7 +1152,7 @@ int transport_push(struct transport *transport,
1155
1152
match_flags |= MATCH_REFS_FOLLOW_TAGS ;
1156
1153
1157
1154
if (match_push_refs (local_refs , & remote_refs ,
1158
- refspec_nr , refspec , match_flags )) {
1155
+ rs -> raw_nr , rs -> raw , match_flags )) {
1159
1156
return -1 ;
1160
1157
}
1161
1158
@@ -1186,7 +1183,7 @@ int transport_push(struct transport *transport,
1186
1183
1187
1184
if (!push_unpushed_submodules (& commits ,
1188
1185
transport -> remote ,
1189
- refspec , refspec_nr ,
1186
+ rs -> raw , rs -> raw_nr ,
1190
1187
transport -> push_options ,
1191
1188
pretend )) {
1192
1189
oid_array_clear (& commits );
0 commit comments