gitbutlerapp/gitbutler · error

Commit is not conflicted.

Error message

Commit {commit_oid} is not conflicted.

What it means

Thrown by apply_resolutions when the resolved commit_oid has no conflicts — commit_conflicts returns empty files and manual lists — so there is no conflicted region to replace for the given path/hunk.

Solutions

  1. Confirm the commit still has conflicts with `but status` / listing conflicts.
  2. Use the correct conflicted commit id.
  3. If already resolved, run `but resolve finish`.

Example fix

// before
but resolve 99fead1 src/main.rs --ours   # 99fead1 not conflicted
// after
but resolve <conflicted-commit-id> src/main.rs --ours
Defensive patterns

Strategy: validation

Validate before calling

const conflicts = commitConflicts(commitOid);
if (conflicts.files.length === 0 && conflicts.manual.length === 0) {
  throw new Error(`Commit ${commitOid} is not conflicted`);
}

Try / catch

try { await butResolve(commitOid, path) } catch (e) { if (String(e).includes('is not conflicted')) { pickAnotherCommit(); } }

Prevention

When it happens

Trigger: `but resolve <commit> <path>` where the commit is fully resolved already, or the hunk argument is omitted and the commit turns out to have no conflicts at all.

Common situations: Re-running a resolve after the conflict was fixed; targeting the wrong commit in a multi-commit conflict; conflicts finished by a teammate between attempts.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/e1079c94927d8785. Report an issue: GitHub.

Appendix: source

Thrown at crates/but/src/command/legacy/resolve.rs:937

                if content.is_empty() {
                    bail!(
                        "stdin was empty. To intentionally delete the conflicted region, pass --file with an empty file."
                    );
                }
                content
            }
        };
        HunkResolution::Content(content)
    };

    // Expand a bare path into explicit per-hunk specs; an explicit `:<N>`
    // target needs no lookup, the API validates it.
    let hunks: Vec<usize> = match (hunk, &resolution) {
        (Some(hunk), _) => vec![hunk],
        (None, _) => {
            let conflicts = but_api::resolve::commit_conflicts(ctx, commit_oid)?;
            if conflicts.files.is_empty() && conflicts.manual.is_empty() {
                bail!("Commit {commit_oid} is not conflicted.");
            }
            // Match with the same normalization the API applies, so spellings
            // it would accept (`./`, backslashes, duplicate slashes) resolve.
            let lookup = but_api::resolve::normalize_path(path);
            if let Some(manual) = conflicts
                .manual
                .iter()
                .find(|file| but_api::resolve::normalize_path(&file.path) == lookup)
            {
                bail!(
                    "\"{path}\" cannot be resolved this way: {} Resolve this commit in edit mode instead.",
                    manual.reason
                );
            }
            let total_hunks = conflicts
                .files
                .iter()
                .find(|conflicted| but_api::resolve::normalize_path(&conflicted.path) == lookup)

View on GitHub (pinned to 58e5313667)