|
20 | 20 | #include "worktree.h"
|
21 | 21 | #include "parse-options.h"
|
22 | 22 |
|
23 |
| -static int config_fetch_recurse_submodules = RECURSE_SUBMODULES_ON_DEMAND; |
24 | 23 | static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
|
25 | 24 | static struct string_list changed_submodule_paths = STRING_LIST_INIT_DUP;
|
26 | 25 | static int initialized_fetch_ref_tips;
|
@@ -160,10 +159,6 @@ static int git_modules_config(const char *var, const char *value, void *cb)
|
160 | 159 | {
|
161 | 160 | if (starts_with(var, "submodule."))
|
162 | 161 | return parse_submodule_config_option(var, value);
|
163 |
| - else if (!strcmp(var, "fetch.recursesubmodules")) { |
164 |
| - config_fetch_recurse_submodules = parse_fetch_recurse_submodules_arg(var, value); |
165 |
| - return 0; |
166 |
| - } |
167 | 162 | return 0;
|
168 | 163 | }
|
169 | 164 |
|
@@ -714,11 +709,6 @@ void show_submodule_inline_diff(FILE *f, const char *path,
|
714 | 709 | clear_commit_marks(right, ~0);
|
715 | 710 | }
|
716 | 711 |
|
717 |
| -void set_config_fetch_recurse_submodules(int value) |
718 |
| -{ |
719 |
| - config_fetch_recurse_submodules = value; |
720 |
| -} |
721 |
| - |
722 | 712 | int should_update_submodules(void)
|
723 | 713 | {
|
724 | 714 | return config_update_recurse_submodules == RECURSE_SUBMODULES_ON;
|
@@ -1164,10 +1154,11 @@ struct submodule_parallel_fetch {
|
1164 | 1154 | const char *work_tree;
|
1165 | 1155 | const char *prefix;
|
1166 | 1156 | int command_line_option;
|
| 1157 | + int default_option; |
1167 | 1158 | int quiet;
|
1168 | 1159 | int result;
|
1169 | 1160 | };
|
1170 |
| -#define SPF_INIT {0, ARGV_ARRAY_INIT, NULL, NULL, 0, 0, 0} |
| 1161 | +#define SPF_INIT {0, ARGV_ARRAY_INIT, NULL, NULL, 0, 0, 0, 0} |
1171 | 1162 |
|
1172 | 1163 | static int get_next_submodule(struct child_process *cp,
|
1173 | 1164 | struct strbuf *err, void *data, void **task_cb)
|
@@ -1205,10 +1196,10 @@ static int get_next_submodule(struct child_process *cp,
|
1205 | 1196 | default_argv = "on-demand";
|
1206 | 1197 | }
|
1207 | 1198 | } else {
|
1208 |
| - if ((config_fetch_recurse_submodules == RECURSE_SUBMODULES_OFF) || |
| 1199 | + if ((spf->default_option == RECURSE_SUBMODULES_OFF) || |
1209 | 1200 | gitmodules_is_unmerged)
|
1210 | 1201 | continue;
|
1211 |
| - if (config_fetch_recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) { |
| 1202 | + if (spf->default_option == RECURSE_SUBMODULES_ON_DEMAND) { |
1212 | 1203 | if (!unsorted_string_list_lookup(&changed_submodule_paths, ce->name))
|
1213 | 1204 | continue;
|
1214 | 1205 | default_argv = "on-demand";
|
@@ -1275,13 +1266,15 @@ static int fetch_finish(int retvalue, struct strbuf *err,
|
1275 | 1266 |
|
1276 | 1267 | int fetch_populated_submodules(const struct argv_array *options,
|
1277 | 1268 | const char *prefix, int command_line_option,
|
| 1269 | + int default_option, |
1278 | 1270 | int quiet, int max_parallel_jobs)
|
1279 | 1271 | {
|
1280 | 1272 | int i;
|
1281 | 1273 | struct submodule_parallel_fetch spf = SPF_INIT;
|
1282 | 1274 |
|
1283 | 1275 | spf.work_tree = get_git_work_tree();
|
1284 | 1276 | spf.command_line_option = command_line_option;
|
| 1277 | + spf.default_option = default_option; |
1285 | 1278 | spf.quiet = quiet;
|
1286 | 1279 | spf.prefix = prefix;
|
1287 | 1280 |
|
|
0 commit comments