affaan-m/ECC · error · anyhow::Error

Merge blocked between

Error message

Merge blocked between {left_branch} and {right_branch} by {} conflict(s): {detail}

What it means

merge_into_base first checks merge readiness; when the preview reports Conflicted, it aborts by raising the readiness summary listing the conflicting branches and conflict count. The merge must be resolved manually before retrying.

Solutions

  1. Resolve the listed conflicts manually, then retry the merge.
  2. Merge in smaller steps or rebase one branch to reduce conflict surface.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at ecc2/src/worktree/mod.rs:861 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/91252282302b8b44. Report an issue: GitHub.

Appendix: source

Thrown at ecc2/src/worktree/mod.rs:861

    } else {
        Ok(WorktreeHealth::InProgress)
    }
}

pub fn has_uncommitted_changes(worktree: &WorktreeInfo) -> Result<bool> {
    Ok(!git_status_short(&worktree.path)?.is_empty())
}

pub fn has_staged_changes(worktree: &WorktreeInfo) -> Result<bool> {
    Ok(git_status_entries(worktree)?
        .iter()
        .any(|entry| entry.staged))
}

pub fn merge_into_base(worktree: &WorktreeInfo) -> Result<MergeOutcome> {
    let readiness = merge_readiness(worktree)?;
    if readiness.status == MergeReadinessStatus::Conflicted {
        anyhow::bail!(readiness.summary);
    }

    if has_uncommitted_changes(worktree)? {
        anyhow::bail!(
            "Worktree {} has uncommitted changes; commit or discard them before merging",
            worktree.branch
        );
    }

    let repo_root = base_checkout_path(worktree)?;
    let current_branch = get_current_branch(&repo_root)?;
    if current_branch != worktree.base_branch {
        anyhow::bail!(
            "Base branch {} is not checked out in repo root (currently {})",
            worktree.base_branch,
            current_branch
        );
    }

View on GitHub (pinned to 06c5e118c4)