Skip to main content

read_and_diff

Function read_and_diff 

Source
pub fn read_and_diff(files: &[(PathBuf, String)]) -> Vec<FileHunks>
Expand description

The blocking half. Read each changed file and compute its hunk ranges against the baseline the scan collected.

Pure, no tokio, no view access — call it inside spawn_blocking.

A file that fails to read is logged and skipped: one unreadable path must not cost the user every other changed file. A file whose hunks all vanished (it was edited back to the baseline between the status call and the read) contributes nothing rather than an empty group.