{"record":{"id":"7b5da197f858ce1f","repo":"gitbutlerapp/gitbutler","slug":"branch-name-has-no-conflicted-commits","errorCode":null,"errorMessage":"Branch \"{name}\" has no conflicted commits.","messagePattern":"Branch \"(.+?)\" has no conflicted commits\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":671,"sourceCode":"/// Resolve `target` — a commit id, a CLI id, or a branch name (meaning that\n/// branch's oldest conflicted commit) — or default to the oldest conflicted\n/// commit of the first conflicted branch. `Ok(None)` means nothing is\n/// conflicted.\nfn target_conflicted_commit(\n    ctx: &mut Context,\n    target: Option<&str>,\n) -> Result<Option<ConflictTarget>> {\n    let conflicts_by_branch = find_conflicted_commits(ctx)?;\n    let commit_oid = match target {\n        // An exact conflicted-branch name scopes to that branch.\n        Some(target) if conflicts_by_branch.contains_key(target) => {\n            conflicts_by_branch[target][0].commit_oid\n        }\n        Some(target) => match parse_commit_or_branch(ctx, target)? {\n            CommitOrBranch::Commit(commit_oid) => commit_oid,\n            CommitOrBranch::Branch(name) => match conflicts_by_branch.get(&name) {\n                Some(commits) => commits[0].commit_oid,\n                None => bail!(\"Branch \\\"{name}\\\" has no conflicted commits.\"),\n            },\n        },\n        None => match conflicts_by_branch.values().flatten().next() {\n            Some(commit) => commit.commit_oid,\n            None => return Ok(None),\n        },\n    };\n\n    let branch = conflicts_by_branch\n        .iter()\n        .find(|(_, commits)| commits.iter().any(|commit| commit.commit_oid == commit_oid))\n        .map(|(branch, _)| branch.clone());\n    let other_conflicted = conflicts_by_branch\n        .values()\n        .flatten()\n        .filter(|commit| commit.commit_oid != commit_oid)\n        .map(|commit| commit.commit_oid)\n        .collect::<HashSet<_>>()","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/resolve.rs#L653-L689","documentation":"In target_conflicted_commit(), the user-supplied target parsed as a branch name via IdMap, but find_conflicted_commits() has no entry for that branch — no commit on it is currently conflicted. The error scopes conflict operations to branches that actually carry conflicts.","triggerScenarios":"`but resolve conflicts <branch>`, `but resolve --ours <branch>` (or any command routed through target_conflicted_commit) with a valid branch name that has zero conflicted commits — because conflicts were resolved already, or the branch was never part of the conflicted rebase.","commonSituations":"Using a branch name whose conflicts were fixed in a previous session; case/spacing differences making it a different branch than the conflicted one; assuming every applied branch in the workspace is conflicted when only some are.","solutions":["Run `but resolve conflicts` with no target to list branches that currently have conflicted commits","Use a commit id from that listing instead of the branch name","If you expected this branch to be conflicted, re-run the update/rebase that creates the conflicts"],"exampleFix":"# before\nbut resolve conflicts feature-x\n# error: Branch \"feature-x\" has no conflicted commits.\n\n# after\nbut resolve conflicts          # auto-pick the first conflicted branch\nbut resolve conflicts other-br  # a branch that actually shows conflicts","handlingStrategy":"validation","validationCode":"# restrict targets to branches that currently have conflicts\nbut resolve conflicts | awk '/branch/ {print $NF}' > /tmp/conflicted-branches.txt\ngrep -qx \"feature-x\" /tmp/conflicted-branches.txt && but resolve conflicts feature-x","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List conflicted branches first and use one of those names","Branch names are matched exactly (no prefix expansion once parsed as a branch)","After any resolution, re-list: conflicted sets change"],"tags":["gitbutler","conflict-resolution","branch-lookup"],"backgroundTag":"no-conflicts-found","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}