- gitmodules_read_check(repo);
- return config_from(repo->submodule_cache, treeish_name,
- key, lookup_path);
+ struct fetch_config *config = cb;
+ if (!strcmp(var, "submodule.fetchjobs")) {
+ if (config->max_children)
+ *(config->max_children) =
+ parse_submodule_fetchjobs(var, value);
+ return 0;
+ } else if (!strcmp(var, "fetch.recursesubmodules")) {
+ if (config->recurse_submodules)
+ *(config->recurse_submodules) =
+ parse_fetch_recurse_submodules_arg(var, value);
+ return 0;
+ }
+
+ return 0;
+}
+
+void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules)
+{
+ struct fetch_config config = {
+ .max_children = max_children,
+ .recurse_submodules = recurse_submodules
+ };
+ config_from_gitmodules(gitmodules_fetch_config, the_repository, &config);
+}
+
+static int gitmodules_update_clone_config(const char *var, const char *value,
+ void *cb)
+{
+ int *max_jobs = cb;
+ if (!strcmp(var, "submodule.fetchjobs"))
+ *max_jobs = parse_submodule_fetchjobs(var, value);
+ return 0;