Skip to main content

scan_changed_files

Function scan_changed_files 

Source
pub fn scan_changed_files(
    workdir: &Path,
    comparison: ProjectDiffComparison,
) -> Vec<(PathBuf, String)>
Expand description

Collect the changed files and their baseline text.

Blocking by construction, and must run on spawn_blocking. It shells out to git once for the status and once per changed file for the baseline blob; on the editor actor’s current_thread runtime a bare tokio::spawn would put every one of those on the actor thread. Paramount goal #1 — see the standing rule.

Returns (path, baseline_text) pairs. A file whose baseline cannot be read is skipped, not fatal: a newly-added file has no HEAD blob at all, which is a normal state rather than an error, and one unreadable path must not cost the user every other changed file.