{"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":"validation","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/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L653-L689","documentation":"Thrown by target_conflicted_commit when the user names a branch as the conflict target for `but resolve`, but that branch has no conflicted commits recorded in conflicts_by_branch. The branch exists and parses, it simply is not part of any conflict. It is a lookup miss against the current conflict state.","triggerScenarios":"Running `but resolve <branchname> ...` (via list_conflicts or apply_resolutions) where the named branch is healthy — no merge/apply conflicts are pending on it.","commonSituations":"Typo in the branch name; the conflict was already resolved on that branch; or the user assumes a branch is conflicted because another one is.","solutions":["Run `but status` or `but resolve` with no target to list conflicted commits/branches.","Verify the branch name spelling.","Resolve on the branch that actually carries the conflicted commit."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const conflictedBranches = listConflicts().map(c => c.branch);\nif (!conflictedBranches.includes(branchName)) throw new Error(`Branch \"${branchName}\" has no conflicted commits`);","typeGuard":null,"tryCatchPattern":"try { await butResolve(branch) } catch (e) { if (String(e).includes('has no conflicted commits')) { showConflictList(); } }","preventionTips":["List conflicted branches before targeting one.","Copy branch names from `but status` instead of typing them.","Re-check conflict state after each resolution."],"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"}