diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-10-12 23:02:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-12 14:12:41 -0700 |
commit | 36d69bf77e26793277d2708dd9ddad078e7e67a2 (patch) | |
tree | 9f04479810731b8c1aa7d7f4058e77462e886d29 /builtin/fetch.c | |
parent | 6e5ba0bae447dba2adabea588b248b5fc6f59cd6 (diff) | |
download | git-36d69bf77e26793277d2708dd9ddad078e7e67a2.tar.gz |
run-command API: move *_tr2() users to "run_processes_parallel()"
Have the users of the "run_processes_parallel_tr2()" function use
"run_processes_parallel()" instead. In preceding commits the latter
was refactored to take a "struct run_process_parallel_opts" argument,
since the only reason for "run_processes_parallel_tr2()" to exist was
to take arguments that are now a part of that struct we can do away
with it.
See ee4512ed481 (trace2: create new combined trace facility,
2019-02-22) for the addition of the "*_tr2()" variant of the function,
it was used by every caller except "t/helper/test-run-command.c"..
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 82f1da14ec..b06e454cbd 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1953,15 +1953,21 @@ static int fetch_multiple(struct string_list *list, int max_children) if (max_children != 1 && list->nr != 1) { struct parallel_fetch_state state = { argv.v, list, 0, 0 }; + const struct run_process_parallel_opts opts = { + .tr2_category = "fetch", + .tr2_label = "parallel/fetch", + + .processes = max_children, + + .get_next_task = &fetch_next_remote, + .start_failure = &fetch_failed_to_start, + .task_finished = &fetch_finished, + .data = &state, + }; strvec_push(&argv, "--end-of-options"); - run_processes_parallel_tr2(max_children, - &fetch_next_remote, - &fetch_failed_to_start, - &fetch_finished, - &state, - "fetch", "parallel/fetch"); + run_processes_parallel(&opts); result = state.result; } else for (i = 0; i < list->nr; i++) { |