submodule update: run at most one fetch job unless otherwise set
authorJunio C Hamano <gitster@pobox.com>
Thu, 13 Dec 2018 19:02:48 +0000 (11:02 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Dec 2018 02:54:56 +0000 (11:54 +0900)
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>
builtin/submodule--helper.c
t/t5526-fetch-submodules.sh
index d38113a31aeb3838190b7339475c7454e45f3a89..1f8a4a9d522f6ecc906dd0902167264c097bbffc 100644 (file)
@@ -1551,7 +1551,7 @@ struct submodule_update_clone {
 #define SUBMODULE_UPDATE_CLONE_INIT {0, MODULE_LIST_INIT, 0, \
        SUBMODULE_UPDATE_STRATEGY_INIT, 0, 0, -1, STRING_LIST_INIT_DUP, 0, \
        NULL, NULL, NULL, \
-       NULL, 0, 0, 0, NULL, 0, 0, 0}
+       NULL, 0, 0, 0, NULL, 0, 0, 1}
 
 
 static void next_submodule_warn_missing(struct submodule_update_clone *suc,
index 6c2f9b2ba266ad910769745e72285a840b33238b..a0317556c690262e26ed99cd902ec30c8adda733 100755 (executable)
@@ -524,6 +524,8 @@ test_expect_success 'fetching submodules respects parallel settings' '
        git config fetch.recurseSubmodules true &&
        (
                cd downstream &&
+               GIT_TRACE=$(pwd)/trace.out git fetch &&
+               grep "1 tasks" trace.out &&
                GIT_TRACE=$(pwd)/trace.out git fetch --jobs 7 &&
                grep "7 tasks" trace.out &&
                git config submodule.fetchJobs 8 &&