submodule-config: fix reading submodule.fetchJobs

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>

Saagar Jha committed May 10, 2026 at 03:50 UTC aa45a5902f23975b7075c97ad0451f7b4e9ccd9a
2 files changed +9 -1
submodule-config.c
+1 -1
@@ -1037,5 +1037,5 @@ static int gitmodules_update_clone_config(const char *var, const char *value,
1037
1038 void update_clone_config_from_gitmodules(int *max_jobs)
1039 {
1040 - config_from_gitmodules(gitmodules_update_clone_config, the_repository, &max_jobs);
1040 + config_from_gitmodules(gitmodules_update_clone_config, the_repository, max_jobs);
1041 }
t/t7406-submodule-update.sh
+8
@@ -1055,6 +1055,14 @@ test_expect_success 'submodule update can be run in parallel' '
1055 )
1056 '
1057
1058 +test_expect_success 'submodule update honors fetch jobs config from .gitmodules' '
1059 + test_when_finished "rm -rf super3" &&
1060 + git clone cloned super3 &&
1061 + git -C super3 config -f .gitmodules submodule.fetchJobs 67 &&
1062 + GIT_TRACE="$(pwd)/trace.out" git -C super3 submodule update --init &&
1063 + test_grep "67 tasks" trace.out
1064 +'
1065 +
1066 test_expect_success 'git clone passes the parallel jobs config on to submodules' '
1067 test_when_finished "rm -rf super4" &&
1068 GIT_TRACE=$(pwd)/trace.out git clone --recurse-submodules --jobs 7 . super4 &&