diff options
author | Antonio Ospite <ao2@ao2.it> | 2018-06-26 12:47:06 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-26 12:56:11 -0700 |
commit | 71a6953d164012647fcb9682e4e705ba61b95929 (patch) | |
tree | cf47a6c682cb4dc81cfc893db086530d80395294 /builtin | |
parent | config: move config_from_gitmodules to submodule-config.c (diff) | |
download | tgif-71a6953d164012647fcb9682e4e705ba61b95929.tar.xz |
submodule-config: add helper function to get 'fetch' config from .gitmodules
Add a helper function to make it clearer that retrieving 'fetch'
configuration from the .gitmodules file is a special case supported
solely for backward compatibility purposes.
This change removes one direct use of 'config_from_gitmodules' in code
not strictly related to submodules, in the effort to communicate better
that .gitmodules is not to be used as a mechanism to store arbitrary
configuration in the repository that any command can retrieve.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fetch.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index ea5b9669ad..92a5d235d9 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -93,19 +93,6 @@ static int git_fetch_config(const char *k, const char *v, void *cb) return git_default_config(k, v, cb); } -static int gitmodules_fetch_config(const char *var, const char *value, void *cb) -{ - if (!strcmp(var, "submodule.fetchjobs")) { - max_children = parse_submodule_fetchjobs(var, value); - return 0; - } else if (!strcmp(var, "fetch.recursesubmodules")) { - recurse_submodules = parse_fetch_recurse_submodules_arg(var, value); - return 0; - } - - return 0; -} - static int parse_refmap_arg(const struct option *opt, const char *arg, int unset) { /* @@ -1433,7 +1420,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) for (i = 1; i < argc; i++) strbuf_addf(&default_rla, " %s", argv[i]); - config_from_gitmodules(gitmodules_fetch_config, NULL); + fetch_config_from_gitmodules(&max_children, &recurse_submodules); git_config(git_fetch_config, NULL); argc = parse_options(argc, argv, prefix, |