async fn scan_layer(
cwd: &Path,
ref_spec: &str,
caps: &mut Caps,
budget: Duration,
) -> LayerState<Vec<FileContent>>Expand description
Read one layer: its file list, then one bounded fetch per file.
The fetches run a wave at a time, and each wave is folded as it lands. A section is a raw diff of up to the subprocess output cap, so holding every completed one for the whole read would materialise hundreds of megabytes to carry half a megabyte; a wave is the same in-flight count the overlay’s reader holds, and folding drops the raw text before the next wave starts.