]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule-config: fix reading submodule.fetchJobs
authorSaagar Jha <saagar@saagarjha.com>
Sun, 10 May 2026 03:50:22 +0000 (03:50 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 May 2026 23:25:35 +0000 (08:25 +0900)
update_clone_config_from_gitmodules() passes &max_jobs to
config_from_gitmodules(), but max_jobs is already a pointer. This causes
the config value to be written to the wrong address and get dropped.

Pass max_jobs directly.

Signed-off-by: Saagar Jha <saagar@saagarjha.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule-config.c
t/t7406-submodule-update.sh

index 1f19fe207741bc364cc26321fe2145b18a5c198c..57b190678e8de71dfd53983e7bcff691d4a7c33e 100644 (file)
@@ -1037,5 +1037,5 @@ static int gitmodules_update_clone_config(const char *var, const char *value,
 
 void update_clone_config_from_gitmodules(int *max_jobs)
 {
-       config_from_gitmodules(gitmodules_update_clone_config, the_repository, &max_jobs);
+       config_from_gitmodules(gitmodules_update_clone_config, the_repository, max_jobs);
 }
index 3adab12091a5f0ee83868202073283a20f555558..6abb00876a3372d64c07cbdd510797a0bfcf7655 100755 (executable)
@@ -1055,6 +1055,14 @@ test_expect_success 'submodule update can be run in parallel' '
        )
 '
 
+test_expect_success 'submodule update honors fetch jobs config from .gitmodules' '
+       test_when_finished "rm -rf super3" &&
+       git clone cloned super3 &&
+       git -C super3 config -f .gitmodules submodule.fetchJobs 67 &&
+       GIT_TRACE="$(pwd)/trace.out" git -C super3 submodule update --init &&
+       test_grep "67 tasks" trace.out
+'
+
 test_expect_success 'git clone passes the parallel jobs config on to submodules' '
        test_when_finished "rm -rf super4" &&
        GIT_TRACE=$(pwd)/trace.out git clone --recurse-submodules --jobs 7 . super4 &&