summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-08-03 18:19:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-03 20:11:01 (GMT)
commit492c6c46da7847370d8ce0e6d369ae62215b6f8e (patch)
tree906e33b2e68b6da6d7fa35f4bf9219457378155a /submodule.c
parentec6141a0f290ba5a0cea2d15820be0223467e656 (diff)
downloadgit-492c6c46da7847370d8ce0e6d369ae62215b6f8e.zip
git-492c6c46da7847370d8ce0e6d369ae62215b6f8e.tar.gz
git-492c6c46da7847370d8ce0e6d369ae62215b6f8e.tar.bz2
fetch: don't overlay config with submodule-config
Don't rely on overlaying the repository's config on top of the submodule-config, instead query the repository's config directly for the fetch_recurse field. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/submodule.c b/submodule.c
index 8a9b964..59e3d08 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1194,14 +1194,24 @@ static int get_next_submodule(struct child_process *cp,
default_argv = "yes";
if (spf->command_line_option == RECURSE_SUBMODULES_DEFAULT) {
- if (submodule &&
- submodule->fetch_recurse !=
- RECURSE_SUBMODULES_NONE) {
- if (submodule->fetch_recurse ==
- RECURSE_SUBMODULES_OFF)
+ int fetch_recurse = RECURSE_SUBMODULES_NONE;
+
+ if (submodule) {
+ char *key;
+ const char *value;
+
+ fetch_recurse = submodule->fetch_recurse;
+ key = xstrfmt("submodule.%s.fetchRecurseSubmodules", submodule->name);
+ if (!repo_config_get_string_const(the_repository, key, &value)) {
+ fetch_recurse = parse_fetch_recurse_submodules_arg(key, value);
+ }
+ free(key);
+ }
+
+ if (fetch_recurse != RECURSE_SUBMODULES_NONE) {
+ if (fetch_recurse == RECURSE_SUBMODULES_OFF)
continue;
- if (submodule->fetch_recurse ==
- RECURSE_SUBMODULES_ON_DEMAND) {
+ if (fetch_recurse == RECURSE_SUBMODULES_ON_DEMAND) {
if (!unsorted_string_list_lookup(&changed_submodule_paths, ce->name))
continue;
default_argv = "on-demand";