@@ -968,7 +968,7 @@ int find_unpushed_submodules(struct oid_array *commits,
968
968
969
969
static int push_submodule (const char * path ,
970
970
const struct remote * remote ,
971
- const char * * refspec , int refspec_nr ,
971
+ const struct refspec * rs ,
972
972
const struct string_list * push_options ,
973
973
int dry_run )
974
974
{
@@ -991,8 +991,8 @@ static int push_submodule(const char *path,
991
991
if (remote -> origin != REMOTE_UNCONFIGURED ) {
992
992
int i ;
993
993
argv_array_push (& cp .args , remote -> name );
994
- for (i = 0 ; i < refspec_nr ; i ++ )
995
- argv_array_push (& cp .args , refspec [i ]);
994
+ for (i = 0 ; i < rs -> raw_nr ; i ++ )
995
+ argv_array_push (& cp .args , rs -> raw [i ]);
996
996
}
997
997
998
998
prepare_submodule_repo_env (& cp .env_array );
@@ -1013,7 +1013,7 @@ static int push_submodule(const char *path,
1013
1013
*/
1014
1014
static void submodule_push_check (const char * path , const char * head ,
1015
1015
const struct remote * remote ,
1016
- const char * * refspec , int refspec_nr )
1016
+ const struct refspec * rs )
1017
1017
{
1018
1018
struct child_process cp = CHILD_PROCESS_INIT ;
1019
1019
int i ;
@@ -1023,8 +1023,8 @@ static void submodule_push_check(const char *path, const char *head,
1023
1023
argv_array_push (& cp .args , head );
1024
1024
argv_array_push (& cp .args , remote -> name );
1025
1025
1026
- for (i = 0 ; i < refspec_nr ; i ++ )
1027
- argv_array_push (& cp .args , refspec [i ]);
1026
+ for (i = 0 ; i < rs -> raw_nr ; i ++ )
1027
+ argv_array_push (& cp .args , rs -> raw [i ]);
1028
1028
1029
1029
prepare_submodule_repo_env (& cp .env_array );
1030
1030
cp .git_cmd = 1 ;
@@ -1043,7 +1043,7 @@ static void submodule_push_check(const char *path, const char *head,
1043
1043
1044
1044
int push_unpushed_submodules (struct oid_array * commits ,
1045
1045
const struct remote * remote ,
1046
- const char * * refspec , int refspec_nr ,
1046
+ const struct refspec * rs ,
1047
1047
const struct string_list * push_options ,
1048
1048
int dry_run )
1049
1049
{
@@ -1069,16 +1069,15 @@ int push_unpushed_submodules(struct oid_array *commits,
1069
1069
1070
1070
for (i = 0 ; i < needs_pushing .nr ; i ++ )
1071
1071
submodule_push_check (needs_pushing .items [i ].string ,
1072
- head , remote ,
1073
- refspec , refspec_nr );
1072
+ head , remote , rs );
1074
1073
free (head );
1075
1074
}
1076
1075
1077
1076
/* Actually push the submodules */
1078
1077
for (i = 0 ; i < needs_pushing .nr ; i ++ ) {
1079
1078
const char * path = needs_pushing .items [i ].string ;
1080
1079
fprintf (stderr , "Pushing submodule '%s'\n" , path );
1081
- if (!push_submodule (path , remote , refspec , refspec_nr ,
1080
+ if (!push_submodule (path , remote , rs ,
1082
1081
push_options , dry_run )) {
1083
1082
fprintf (stderr , "Unable to push submodule '%s'\n" , path );
1084
1083
ret = 0 ;
0 commit comments