@@ -968,7 +968,7 @@ int find_unpushed_submodules(struct oid_array *commits,
968968
969969static int push_submodule (const char * path ,
970970 const struct remote * remote ,
971- const char * * refspec , int refspec_nr ,
971+ const struct refspec * rs ,
972972 const struct string_list * push_options ,
973973 int dry_run )
974974{
@@ -991,8 +991,8 @@ static int push_submodule(const char *path,
991991 if (remote -> origin != REMOTE_UNCONFIGURED ) {
992992 int i ;
993993 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 ]);
996996 }
997997
998998 prepare_submodule_repo_env (& cp .env_array );
@@ -1013,7 +1013,7 @@ static int push_submodule(const char *path,
10131013 */
10141014static void submodule_push_check (const char * path , const char * head ,
10151015 const struct remote * remote ,
1016- const char * * refspec , int refspec_nr )
1016+ const struct refspec * rs )
10171017{
10181018 struct child_process cp = CHILD_PROCESS_INIT ;
10191019 int i ;
@@ -1023,8 +1023,8 @@ static void submodule_push_check(const char *path, const char *head,
10231023 argv_array_push (& cp .args , head );
10241024 argv_array_push (& cp .args , remote -> name );
10251025
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 ]);
10281028
10291029 prepare_submodule_repo_env (& cp .env_array );
10301030 cp .git_cmd = 1 ;
@@ -1043,7 +1043,7 @@ static void submodule_push_check(const char *path, const char *head,
10431043
10441044int push_unpushed_submodules (struct oid_array * commits ,
10451045 const struct remote * remote ,
1046- const char * * refspec , int refspec_nr ,
1046+ const struct refspec * rs ,
10471047 const struct string_list * push_options ,
10481048 int dry_run )
10491049{
@@ -1069,16 +1069,15 @@ int push_unpushed_submodules(struct oid_array *commits,
10691069
10701070 for (i = 0 ; i < needs_pushing .nr ; i ++ )
10711071 submodule_push_check (needs_pushing .items [i ].string ,
1072- head , remote ,
1073- refspec , refspec_nr );
1072+ head , remote , rs );
10741073 free (head );
10751074 }
10761075
10771076 /* Actually push the submodules */
10781077 for (i = 0 ; i < needs_pushing .nr ; i ++ ) {
10791078 const char * path = needs_pushing .items [i ].string ;
10801079 fprintf (stderr , "Pushing submodule '%s'\n" , path );
1081- if (!push_submodule (path , remote , refspec , refspec_nr ,
1080+ if (!push_submodule (path , remote , rs ,
10821081 push_options , dry_run )) {
10831082 fprintf (stderr , "Unable to push submodule '%s'\n" , path );
10841083 ret = 0 ;
0 commit comments