submodule: extract get_fetch_task()
commit73bc90d7e19c471318e799624b6d4c6d449c655d
authorGlen Choo <chooglen@google.com>
Tue, 8 Mar 2022 00:14:30 +0000 (7 16:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Mar 2022 00:51:03 +0000 (7 16:51 -0800)
tree51a7e2eccfe47146fe967ab50df008c3c202ecb9
parent6e1e0c9959f1df4b8c5aafb69d149374720b26dc
submodule: extract get_fetch_task()

get_next_submodule() configures the parallel submodule fetch by
performing two functions:

* iterate the index to find submodules
* configure the child processes to fetch the submodules found in the
  previous step

Extract the index iterating code into an iterator function,
get_fetch_task(), so that get_next_submodule() is agnostic of how
to find submodules. This prepares for a subsequent commit will teach the
fetch machinery to also iterate through the list of changed
submodules (in addition to the index).

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c