Skip to main content

scan_untracked

Function scan_untracked 

Source
async fn scan_untracked(
    cwd: &Path,
    budget: Duration,
) -> (Vec<FileHunks>, bool, usize)
Expand description

Read untracked files from git ls-files --others --exclude-standard and synthesise a FileHunks for each one (status Untracked, single all-added hunk). Caps total count at MAX_UNTRACKED_FILES - when the working tree has more untracked entries than that, returns an empty Vec so a fresh-repo state doesn’t dump hundreds of files into the overlay.

Returns (files, ok, suppressed):

  • ok = false only when the underlying ls-files subprocess hit Failed / Oversize. The cap-exceeded path keeps ok = true because git ran fine.
  • suppressed is the count of untracked files that didn’t make it into files due to MAX_UNTRACKED_FILES. Zero when the tree was under the cap (or empty); positive when the cap kicked in so the renderer can surface the truncation count.