fetch: fix --no-recurse-submodules with multi-remote fetches
When running `git fetch --no-recurse-submodules`, the exectation is that
we don't fetch any submodules. And while this works for fetches of a
single remote, it doesn't when fetching multiple remotes at once. The
result is that we do recurse into submodules even though the user has
explicitly asked us not to.
This is because while we pass on `--recurse-submodules={yes,on-demand}`
if specified by the user, we don't pass on `--no-recurse-submodules` to
the subprocess spawned to perform the submodule fetch.
Fix this by also forwarding this flag as expected.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
667fcf4e15
commit
5667141e3b
@ -1879,6 +1879,8 @@ static void add_options_to_argv(struct strvec *argv)
|
||||
strvec_push(argv, "--keep");
|
||||
if (recurse_submodules == RECURSE_SUBMODULES_ON)
|
||||
strvec_push(argv, "--recurse-submodules");
|
||||
else if (recurse_submodules == RECURSE_SUBMODULES_OFF)
|
||||
strvec_push(argv, "--no-recurse-submodules");
|
||||
else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
|
||||
strvec_push(argv, "--recurse-submodules=on-demand");
|
||||
if (tags == TAGS_SET)
|
||||
|
||||
Reference in New Issue
Block a user