@@ -766,7 +766,8 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,
766
766
* have a corresponding 'struct oid_array' (in the 'util' field) which lists
767
767
* what the submodule pointers were updated to during the change.
768
768
*/
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 ,
770
771
struct argv_array * argv )
771
772
{
772
773
struct rev_info rev ;
@@ -930,8 +931,10 @@ static int submodule_needs_pushing(const char *path, struct oid_array *commits)
930
931
return 0 ;
931
932
}
932
933
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 )
935
938
{
936
939
struct string_list submodules = STRING_LIST_INIT_DUP ;
937
940
struct string_list_item * name ;
@@ -943,7 +946,7 @@ int find_unpushed_submodules(struct oid_array *commits,
943
946
argv_array_push (& argv , "--not" );
944
947
argv_array_pushf (& argv , "--remotes=%s" , remotes_name );
945
948
946
- collect_changed_submodules (& submodules , & argv );
949
+ collect_changed_submodules (istate , & submodules , & argv );
947
950
948
951
for_each_string_list_item (name , & submodules ) {
949
952
struct oid_array * commits = name -> util ;
@@ -1044,7 +1047,8 @@ static void submodule_push_check(const char *path, const char *head,
1044
1047
die ("process for submodule '%s' failed" , path );
1045
1048
}
1046
1049
1047
- int push_unpushed_submodules (struct oid_array * commits ,
1050
+ int push_unpushed_submodules (struct index_state * istate ,
1051
+ struct oid_array * commits ,
1048
1052
const struct remote * remote ,
1049
1053
const struct refspec * rs ,
1050
1054
const struct string_list * push_options ,
@@ -1053,7 +1057,8 @@ int push_unpushed_submodules(struct oid_array *commits,
1053
1057
int i , ret = 1 ;
1054
1058
struct string_list needs_pushing = STRING_LIST_INIT_DUP ;
1055
1059
1056
- if (!find_unpushed_submodules (commits , remote -> name , & needs_pushing ))
1060
+ if (!find_unpushed_submodules (istate , commits ,
1061
+ remote -> name , & needs_pushing ))
1057
1062
return 1 ;
1058
1063
1059
1064
/*
@@ -1110,7 +1115,7 @@ void check_for_new_submodule_commits(struct object_id *oid)
1110
1115
oid_array_append (& ref_tips_after_fetch , oid );
1111
1116
}
1112
1117
1113
- static void calculate_changed_submodule_paths (void )
1118
+ static void calculate_changed_submodule_paths (struct index_state * istate )
1114
1119
{
1115
1120
struct argv_array argv = ARGV_ARRAY_INIT ;
1116
1121
struct string_list changed_submodules = STRING_LIST_INIT_DUP ;
@@ -1131,7 +1136,7 @@ static void calculate_changed_submodule_paths(void)
1131
1136
* Collect all submodules (whether checked out or not) for which new
1132
1137
* commits have been recorded upstream in "changed_submodule_names".
1133
1138
*/
1134
- collect_changed_submodules (& changed_submodules , & argv );
1139
+ collect_changed_submodules (istate , & changed_submodules , & argv );
1135
1140
1136
1141
for_each_string_list_item (name , & changed_submodules ) {
1137
1142
struct oid_array * commits = name -> util ;
@@ -1158,7 +1163,8 @@ static void calculate_changed_submodule_paths(void)
1158
1163
initialized_fetch_ref_tips = 0 ;
1159
1164
}
1160
1165
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 ,
1162
1168
struct object_id * incl_oid )
1163
1169
{
1164
1170
struct string_list subs = STRING_LIST_INIT_DUP ;
@@ -1176,7 +1182,7 @@ int submodule_touches_in_range(struct object_id *excl_oid,
1176
1182
argv_array_push (& args , oid_to_hex (excl_oid ));
1177
1183
}
1178
1184
1179
- collect_changed_submodules (& subs , & args );
1185
+ collect_changed_submodules (istate , & subs , & args );
1180
1186
ret = subs .nr ;
1181
1187
1182
1188
argv_array_clear (& args );
@@ -1346,7 +1352,7 @@ int fetch_populated_submodules(struct repository *r,
1346
1352
argv_array_push (& spf .args , "--recurse-submodules-default" );
1347
1353
/* default value, "--submodule-prefix" and its value are added later */
1348
1354
1349
- calculate_changed_submodule_paths ();
1355
+ calculate_changed_submodule_paths (r -> index );
1350
1356
run_processes_parallel (max_parallel_jobs ,
1351
1357
get_next_submodule ,
1352
1358
fetch_start_failure ,
0 commit comments