diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-10-27 23:51:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-27 23:51:53 +0200 |
commit | 6ae1a6eaf2630365c8dd6f8764881b79ba6899ff (patch) | |
tree | 819dbc41fe53a4b9b5aaa7fa9bd56cd18ca4247a /builtin/submodule--helper.c | |
parent | Merge branch 'tb/save-keep-pack-during-geometric-repack' (diff) | |
parent | run-command.c: remove "max_processes", add "const" to signal() handler (diff) | |
download | git-6ae1a6eaf2630365c8dd6f8764881b79ba6899ff.tar.xz git-6ae1a6eaf2630365c8dd6f8764881b79ba6899ff.zip |
Merge branch 'ab/run-hook-api-cleanup'
Move a global variable added as a hack during regression fixes to
its proper place in the API.
* ab/run-hook-api-cleanup:
run-command.c: remove "max_processes", add "const" to signal() handler
run-command.c: pass "opts" further down, and use "opts->processes"
run-command.c: use "opts->processes", not "pp->max_processes"
run-command.c: don't copy "data" to "struct parallel_processes"
run-command.c: don't copy "ungroup" to "struct parallel_processes"
run-command.c: don't copy *_fn to "struct parallel_processes"
run-command.c: make "struct parallel_processes" const if possible
run-command API: move *_tr2() users to "run_processes_parallel()"
run-command API: have run_process_parallel() take an "opts" struct
run-command.c: use designated init for pp_init(), add "const"
run-command API: don't fall back on online_cpus()
run-command API: make "n" parameter a "size_t"
run-command tests: use "return", not "exit"
run-command API: have "run_processes_parallel{,_tr2}()" return void
run-command test helper: use "else if" pattern
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r-- | builtin/submodule--helper.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 1e29a3d7dc..a7683d3529 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2567,12 +2567,20 @@ static int update_submodules(struct update_data *update_data) { int i, ret = 0; struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT; + const struct run_process_parallel_opts opts = { + .tr2_category = "submodule", + .tr2_label = "parallel/update", + + .processes = update_data->max_jobs, + + .get_next_task = update_clone_get_next_task, + .start_failure = update_clone_start_failure, + .task_finished = update_clone_task_finished, + .data = &suc, + }; suc.update_data = update_data; - run_processes_parallel_tr2(suc.update_data->max_jobs, update_clone_get_next_task, - update_clone_start_failure, - update_clone_task_finished, &suc, "submodule", - "parallel/update"); + run_processes_parallel(&opts); /* * We saved the output and put it out all at once now. |