submodule update: run at most one fetch job unless otherwise set

In a028a1930c (fetching submodules: respect `submodule.fetchJobs` config option, 2016-02-29), we made sure to keep the default behavior of fetching at most one submodule at once when not setting the newly introduced `submodule.fetchJobs` config. This regressed in 90efe595c5 (builtin/submodule--helper: factor out submodule updating, 2018-08-03). Fix it. Reported-by: Sjon Hortensius <sjon@parse.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Dec 13, 2018 at 11:02 UTC e3a9d1aca92d90f2fdfbefd29827f7d7d210947e
2 files changed +3 -1
builtin/submodule--helper.c
+1 -1
@@ -1551,7 +1551,7 @@ struct submodule_update_clone {
1551 #define SUBMODULE_UPDATE_CLONE_INIT {0, MODULE_LIST_INIT, 0, \
1552 SUBMODULE_UPDATE_STRATEGY_INIT, 0, 0, -1, STRING_LIST_INIT_DUP, 0, \
1553 NULL, NULL, NULL, \
1554 - NULL, 0, 0, 0, NULL, 0, 0, 0}
1554 + NULL, 0, 0, 0, NULL, 0, 0, 1}
1555
1556
1557 static void next_submodule_warn_missing(struct submodule_update_clone *suc,
t/t5526-fetch-submodules.sh
+2
@@ -524,6 +524,8 @@ test_expect_success 'fetching submodules respects parallel settings' '
524 git config fetch.recurseSubmodules true &&
525 (
526 cd downstream &&
527 + GIT_TRACE=$(pwd)/trace.out git fetch &&
528 + grep "1 tasks" trace.out &&
529 GIT_TRACE=$(pwd)/trace.out git fetch --jobs 7 &&
530 grep "7 tasks" trace.out &&
531 git config submodule.fetchJobs 8 &&