Skip to content

Commit 492c6c4

Browse files
bmwillgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ec6141a commit 492c6c4

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

builtin/fetch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
13621362

13631363
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
13641364
gitmodules_config();
1365-
git_config(submodule_config, NULL);
13661365
}
13671366

13681367
if (all) {

submodule.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,14 +1194,24 @@ static int get_next_submodule(struct child_process *cp,
11941194

11951195
default_argv = "yes";
11961196
if (spf->command_line_option == RECURSE_SUBMODULES_DEFAULT) {
1197-
if (submodule &&
1198-
submodule->fetch_recurse !=
1199-
RECURSE_SUBMODULES_NONE) {
1200-
if (submodule->fetch_recurse ==
1201-
RECURSE_SUBMODULES_OFF)
1197+
int fetch_recurse = RECURSE_SUBMODULES_NONE;
1198+
1199+
if (submodule) {
1200+
char *key;
1201+
const char *value;
1202+
1203+
fetch_recurse = submodule->fetch_recurse;
1204+
key = xstrfmt("submodule.%s.fetchRecurseSubmodules", submodule->name);
1205+
if (!repo_config_get_string_const(the_repository, key, &value)) {
1206+
fetch_recurse = parse_fetch_recurse_submodules_arg(key, value);
1207+
}
1208+
free(key);
1209+
}
1210+
1211+
if (fetch_recurse != RECURSE_SUBMODULES_NONE) {
1212+
if (fetch_recurse == RECURSE_SUBMODULES_OFF)
12021213
continue;
1203-
if (submodule->fetch_recurse ==
1204-
RECURSE_SUBMODULES_ON_DEMAND) {
1214+
if (fetch_recurse == RECURSE_SUBMODULES_ON_DEMAND) {
12051215
if (!unsorted_string_list_lookup(&changed_submodule_paths, ce->name))
12061216
continue;
12071217
default_argv = "on-demand";

0 commit comments

Comments
 (0)