Skip to main content

detect_changes

Function detect_changes 

Source
pub async fn detect_changes(config: InputConfig<'_>) -> Result<ProcessedResult>
Expand description

Detect changed files between two git references

This is the main entry point for the library. It handles:

  • SHA resolution
  • Diff computation
  • Pattern filtering
  • Submodule processing
  • Symlink detection
  • Workflow intelligence

Returns a ProcessedResult with index-based partitioning for both filtered and unfiltered file sets.

ยงExample

use lechange_core::{InputConfig, detect_changes};
use std::borrow::Cow;

let config = InputConfig {
    base_sha: Some(Cow::Borrowed("main")),
    sha: Some(Cow::Borrowed("HEAD")),
    ..Default::default()
};

let result = detect_changes(config).await?;
println!("Files changed: {}", result.all_files.len());