summaryrefslogtreecommitdiff
path: root/builtin/pull.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-20 22:26:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-05-20 22:26:57 (GMT)
commited54e1b31ad1a9a35ef6c23024d325a2c4d85221 (patch)
tree1ff81c3b02ad0d08b69c21773143d5bc770ba73e /builtin/pull.c
parent1dff6dc016a3b20e92910004ade1c13339b6fe7f (diff)
parent58194173652786709ba9dd1f56df6922a92f419f (diff)
downloadgit-ed54e1b31ad1a9a35ef6c23024d325a2c4d85221.zip
git-ed54e1b31ad1a9a35ef6c23024d325a2c4d85221.tar.gz
git-ed54e1b31ad1a9a35ef6c23024d325a2c4d85221.tar.bz2
Merge branch 'gc/pull-recurse-submodules'
"git pull" without "--recurse-submodules=<arg>" made submodule.recurse take precedence over fetch.recurseSubmodules by mistake, which has been corrected. * gc/pull-recurse-submodules: pull: do not let submodule.recurse override fetch.recurseSubmodules
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index 4d667ab..01155ba 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -72,6 +72,7 @@ static const char * const pull_usage[] = {
static int opt_verbosity;
static char *opt_progress;
static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
+static int recurse_submodules_cli = RECURSE_SUBMODULES_DEFAULT;
/* Options passed to git-merge or git-rebase */
static enum rebase_type opt_rebase = -1;
@@ -120,7 +121,7 @@ static struct option pull_options[] = {
N_("force progress reporting"),
PARSE_OPT_NOARG),
OPT_CALLBACK_F(0, "recurse-submodules",
- &recurse_submodules, N_("on-demand"),
+ &recurse_submodules_cli, N_("on-demand"),
N_("control for recursive fetching of submodules"),
PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules),
@@ -536,8 +537,8 @@ static int run_fetch(const char *repo, const char **refspecs)
strvec_push(&args, opt_tags);
if (opt_prune)
strvec_push(&args, opt_prune);
- if (recurse_submodules != RECURSE_SUBMODULES_DEFAULT)
- switch (recurse_submodules) {
+ if (recurse_submodules_cli != RECURSE_SUBMODULES_DEFAULT)
+ switch (recurse_submodules_cli) {
case RECURSE_SUBMODULES_ON:
strvec_push(&args, "--recurse-submodules=on");
break;
@@ -1001,6 +1002,9 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);
+ if (recurse_submodules_cli != RECURSE_SUBMODULES_DEFAULT)
+ recurse_submodules = recurse_submodules_cli;
+
if (cleanup_arg)
/*
* this only checks the validity of cleanup_arg; we don't need