Extract logic for directory packages

In addition to improving readability, this also fixes a subtle bug
where the Progress node could display the wrong total number of packages to fetch.
e07e182fc1Adam Goertz committed on 9/29/2023, 7:32:43 AM· committed by Andrew Kelleyparent4594206
1 file changedLine totals unavailable