Skip to main content

compute_state_diff

Function compute_state_diff 

Source
pub fn compute_state_diff(
    repo: &Repository,
    from_change_id: &ChangeId,
    to_change_id: &ChangeId,
    semantic: bool,
    unified: usize,
) -> Result<DiffReport>
Expand description

Compute a state-to-state diff payload without printing.

Reuses the same line-rendering pipeline as cmd_diff’s state-to-state path: object-store lookups for both sides, diff_blobs for modified files, hunk grouping via unified_hunks. The result is the same DiffReport shape that cmd_diff serializes, so callers can embed it inside their own JSON payload.

Used by heddle merge --with-diff to surface the diff that would land (or just landed) without a separate heddle diff invocation.

semantic requests the semantic change list in addition to the line-level hunks. Building with --features semantic is required; otherwise this errors out the same way cmd_diff --semantic does.