diff options
-rw-r--r-- | builtin/submodule--helper.c | 8 | ||||
-rw-r--r-- | submodule-config.c | 14 | ||||
-rw-r--r-- | submodule-config.h | 1 |
3 files changed, 19 insertions, 4 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 20ae9191ca..110a47eca2 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1706,8 +1706,8 @@ static int update_clone_task_finished(int result, return 0; } -static int gitmodules_update_clone_config(const char *var, const char *value, - void *cb) +static int git_update_clone_config(const char *var, const char *value, + void *cb) { int *max_jobs = cb; if (!strcmp(var, "submodule.fetchjobs")) @@ -1757,8 +1757,8 @@ static int update_clone(int argc, const char **argv, const char *prefix) }; suc.prefix = prefix; - config_from_gitmodules(gitmodules_update_clone_config, &max_jobs); - git_config(gitmodules_update_clone_config, &max_jobs); + update_clone_config_from_gitmodules(&max_jobs); + git_config(git_update_clone_config, &max_jobs); argc = parse_options(argc, argv, prefix, module_update_clone_options, git_submodule_helper_usage, 0); diff --git a/submodule-config.c b/submodule-config.c index f44d6a7775..9a2b13d8bc 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -716,3 +716,17 @@ void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules) }; config_from_gitmodules(gitmodules_fetch_config, &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; +} + +void update_clone_config_from_gitmodules(int *max_jobs) +{ + config_from_gitmodules(gitmodules_update_clone_config, &max_jobs); +} diff --git a/submodule-config.h b/submodule-config.h index cff297a75f..b6f19d0d42 100644 --- a/submodule-config.h +++ b/submodule-config.h @@ -67,5 +67,6 @@ int check_submodule_name(const char *name); extern void config_from_gitmodules(config_fn_t fn, void *data); extern void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules); +extern void update_clone_config_from_gitmodules(int *max_jobs); #endif /* SUBMODULE_CONFIG_H */ |