@@ -766,7 +766,8 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,
766766 * have a corresponding 'struct oid_array' (in the 'util' field) which lists
767767 * what the submodule pointers were updated to during the change.
768768 */
769- static void collect_changed_submodules (struct string_list * changed ,
769+ static void collect_changed_submodules (struct index_state * istate ,
770+ struct string_list * changed ,
770771 struct argv_array * argv )
771772{
772773 struct rev_info rev ;
@@ -930,8 +931,10 @@ static int submodule_needs_pushing(const char *path, struct oid_array *commits)
930931 return 0 ;
931932}
932933
933- int find_unpushed_submodules (struct oid_array * commits ,
934- const char * remotes_name , struct string_list * needs_pushing )
934+ int find_unpushed_submodules (struct index_state * istate ,
935+ struct oid_array * commits ,
936+ const char * remotes_name ,
937+ struct string_list * needs_pushing )
935938{
936939 struct string_list submodules = STRING_LIST_INIT_DUP ;
937940 struct string_list_item * name ;
@@ -943,7 +946,7 @@ int find_unpushed_submodules(struct oid_array *commits,
943946 argv_array_push (& argv , "--not" );
944947 argv_array_pushf (& argv , "--remotes=%s" , remotes_name );
945948
946- collect_changed_submodules (& submodules , & argv );
949+ collect_changed_submodules (istate , & submodules , & argv );
947950
948951 for_each_string_list_item (name , & submodules ) {
949952 struct oid_array * commits = name -> util ;
@@ -1044,7 +1047,8 @@ static void submodule_push_check(const char *path, const char *head,
10441047 die ("process for submodule '%s' failed" , path );
10451048}
10461049
1047- int push_unpushed_submodules (struct oid_array * commits ,
1050+ int push_unpushed_submodules (struct index_state * istate ,
1051+ struct oid_array * commits ,
10481052 const struct remote * remote ,
10491053 const struct refspec * rs ,
10501054 const struct string_list * push_options ,
@@ -1053,7 +1057,8 @@ int push_unpushed_submodules(struct oid_array *commits,
10531057 int i , ret = 1 ;
10541058 struct string_list needs_pushing = STRING_LIST_INIT_DUP ;
10551059
1056- if (!find_unpushed_submodules (commits , remote -> name , & needs_pushing ))
1060+ if (!find_unpushed_submodules (istate , commits ,
1061+ remote -> name , & needs_pushing ))
10571062 return 1 ;
10581063
10591064 /*
@@ -1110,7 +1115,7 @@ void check_for_new_submodule_commits(struct object_id *oid)
11101115 oid_array_append (& ref_tips_after_fetch , oid );
11111116}
11121117
1113- static void calculate_changed_submodule_paths (void )
1118+ static void calculate_changed_submodule_paths (struct index_state * istate )
11141119{
11151120 struct argv_array argv = ARGV_ARRAY_INIT ;
11161121 struct string_list changed_submodules = STRING_LIST_INIT_DUP ;
@@ -1131,7 +1136,7 @@ static void calculate_changed_submodule_paths(void)
11311136 * Collect all submodules (whether checked out or not) for which new
11321137 * commits have been recorded upstream in "changed_submodule_names".
11331138 */
1134- collect_changed_submodules (& changed_submodules , & argv );
1139+ collect_changed_submodules (istate , & changed_submodules , & argv );
11351140
11361141 for_each_string_list_item (name , & changed_submodules ) {
11371142 struct oid_array * commits = name -> util ;
@@ -1158,7 +1163,8 @@ static void calculate_changed_submodule_paths(void)
11581163 initialized_fetch_ref_tips = 0 ;
11591164}
11601165
1161- int submodule_touches_in_range (struct object_id * excl_oid ,
1166+ int submodule_touches_in_range (struct index_state * istate ,
1167+ struct object_id * excl_oid ,
11621168 struct object_id * incl_oid )
11631169{
11641170 struct string_list subs = STRING_LIST_INIT_DUP ;
@@ -1176,7 +1182,7 @@ int submodule_touches_in_range(struct object_id *excl_oid,
11761182 argv_array_push (& args , oid_to_hex (excl_oid ));
11771183 }
11781184
1179- collect_changed_submodules (& subs , & args );
1185+ collect_changed_submodules (istate , & subs , & args );
11801186 ret = subs .nr ;
11811187
11821188 argv_array_clear (& args );
@@ -1346,7 +1352,7 @@ int fetch_populated_submodules(struct repository *r,
13461352 argv_array_push (& spf .args , "--recurse-submodules-default" );
13471353 /* default value, "--submodule-prefix" and its value are added later */
13481354
1349- calculate_changed_submodule_paths ();
1355+ calculate_changed_submodule_paths (r -> index );
13501356 run_processes_parallel (max_parallel_jobs ,
13511357 get_next_submodule ,
13521358 fetch_start_failure ,
0 commit comments