pub fn detect_changes(
project: &Path,
base_ref: &str,
staged: bool,
language: &Language,
) -> Result<ChangeDetectionResult>Expand description
Detect changed files in project, filtered to the given language.
§Arguments
project- Project root directory (must be inside a git repo)base_ref- Git base reference (e.g. “HEAD”, “main”, “origin/main”)staged- If true, only consider staged changes; otherwise all uncommittedlanguage- Only return files matching this language’s extensions
§Detection Method
staged == true=>"git:staged"staged == falseandbase_ref == "HEAD"=>"git:uncommitted"staged == falseandbase_ref != "HEAD"=>"git:{base_ref}...HEAD"
§Returns
A ChangeDetectionResult with the filtered file list and the detection method string.