{"record":{"id":"e1079c94927d8785","repo":"gitbutlerapp/gitbutler","slug":"commit-commit-oid-is-not-conflicted","errorCode":null,"errorMessage":"Commit {commit_oid} is not conflicted.","messagePattern":"Commit (.+?) is not conflicted\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":937,"sourceCode":"                if content.is_empty() {\n                    bail!(\n                        \"stdin was empty. To intentionally delete the conflicted region, pass --file with an empty file.\"\n                    );\n                }\n                content\n            }\n        };\n        HunkResolution::Content(content)\n    };\n\n    // Expand a bare path into explicit per-hunk specs; an explicit `:<N>`\n    // target needs no lookup, the API validates it.\n    let hunks: Vec<usize> = match (hunk, &resolution) {\n        (Some(hunk), _) => vec![hunk],\n        (None, _) => {\n            let conflicts = but_api::resolve::commit_conflicts(ctx, commit_oid)?;\n            if conflicts.files.is_empty() && conflicts.manual.is_empty() {\n                bail!(\"Commit {commit_oid} is not conflicted.\");\n            }\n            // Match with the same normalization the API applies, so spellings\n            // it would accept (`./`, backslashes, duplicate slashes) resolve.\n            let lookup = but_api::resolve::normalize_path(path);\n            if let Some(manual) = conflicts\n                .manual\n                .iter()\n                .find(|file| but_api::resolve::normalize_path(&file.path) == lookup)\n            {\n                bail!(\n                    \"\\\"{path}\\\" cannot be resolved this way: {} Resolve this commit in edit mode instead.\",\n                    manual.reason\n                );\n            }\n            let total_hunks = conflicts\n                .files\n                .iter()\n                .find(|conflicted| but_api::resolve::normalize_path(&conflicted.path) == lookup)","sourceCodeStart":919,"sourceCodeEnd":955,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L919-L955","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Confirm the commit still has conflicts with `but status` / listing conflicts.","Use the correct conflicted commit id.","If already resolved, run `but resolve finish`."],"exampleFix":"// before\nbut resolve 99fead1 src/main.rs --ours   # 99fead1 not conflicted\n// after\nbut resolve <conflicted-commit-id> src/main.rs --ours","handlingStrategy":"validation","validationCode":"const conflicts = commitConflicts(commitOid);\nif (conflicts.files.length === 0 && conflicts.manual.length === 0) {\n  throw new Error(`Commit ${commitOid} is not conflicted`);\n}","typeGuard":null,"tryCatchPattern":"try { await butResolve(commitOid, path) } catch (e) { if (String(e).includes('is not conflicted')) { pickAnotherCommit(); } }","preventionTips":["Verify the commit still has conflicts before resolving.","Track which commits were already resolved in scripts.","Use `but resolve finish` once all conflicts are handled."],"tags":["cli","git","conflict-resolution","not-found"],"backgroundTag":"record-not-found","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}