Skip to content

Commit e8906a9

Browse files
stefanbellergitster
authored andcommitted
builtin/fetch cleanup: always set default value for submodule recursing
The check for the default was introduced with 88a2197 (fetch/pull: recurse into submodules when necessary, 2011-03-06), which replaced an older construct (builtin/fetchs own implementation of the super-prefix) introduced in be254a0 (Add the 'fetch.recurseSubmodules' config setting, 2010-11-11) which made sense at the time as there was no default fetch option for submodules at the time. Set builtin/fetch.c#recurse_submodules_default to the same value as submodule.c#config_fetch_recurse_submodules which is set via set_config_fetch_recurse_submodules, such that the condition for checking whether we have to set the default value becomes unnecessary. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a6d7eb2 commit e8906a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

builtin/fetch.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static struct transport *gtransport;
4949
static struct transport *gsecondary;
5050
static const char *submodule_prefix = "";
5151
static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
52-
static int recurse_submodules_default = RECURSE_SUBMODULES_DEFAULT;
52+
static int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
5353
static int shown_url = 0;
5454
static int refmap_alloc, refmap_nr;
5555
static const char **refmap_array;
@@ -1336,8 +1336,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
13361336
deepen = 1;
13371337

13381338
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
1339-
if (recurse_submodules_default != RECURSE_SUBMODULES_DEFAULT)
1340-
set_config_fetch_recurse_submodules(recurse_submodules_default);
1339+
set_config_fetch_recurse_submodules(recurse_submodules_default);
13411340
gitmodules_config();
13421341
git_config(submodule_config, NULL);
13431342
}

0 commit comments

Comments
 (0)