Skip to main content

scan

Function scan 

Source
pub async fn scan<'a>(
    cwd: &'a Path,
    snapshot: &'a GitDiffSnapshot,
    base: Option<BaseState>,
    base_ref: Option<&str>,
    base_error: Option<&str>,
) -> DiffContent
Expand description

Read both layers of snapshot for cwd into bounded content.

base is what the read that draws this diff found when it refreshed the remote-tracking base first; it rides the answer so the page can label a base it could not refresh. It is carried only when there is a branch layer to describe.

Infallible like the stats scan: a layer’s failure collapses to LayerState::ScanFailed, a file’s to its own truncated flag, and the read’s to DiffContent::truncated.