forge-engine 0.2.0

Causal edit attribution and structured patch evaluation engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::path::Path;

use crate::error::ForgeResult;

/// Generate a unified diff from (original_dir, patched_dir).
///
/// Prefers `git diff --no-index` if git is on PATH.
/// Falls back to internal line-diff producing valid unified format.
///
/// This is async because it may spawn a `git` subprocess.
pub async fn render_diff(original_dir: &Path, patched_dir: &Path) -> ForgeResult<String> {
    Ok(typed_patch::render_diff(original_dir, patched_dir).await?)
}