{"record":{"id":"56a4518d2cb44f75","repo":"gitbutlerapp/gitbutler","slug":"in-resolution-mode-edit-the-files-and-run-but-re","errorCode":null,"errorMessage":"In resolution mode, edit the files and run `but resolve finish` instead.","messagePattern":"In resolution mode, edit the files and run `but resolve finish` instead\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":132,"sourceCode":"    let repo = ctx.repo.get()?;\n    let index = repo.index_or_empty()?;\n    Ok(index\n        .entries()\n        .iter()\n        .filter(|entry| entry.stage() != gix::index::entry::Stage::Unconflicted)\n        .map(|entry| entry.path(&index).to_string())\n        .collect())\n}\n\n/// Mark the conflicted uncommitted files at `paths` as resolved, taking their\n/// current worktree content.\nfn mark_worktree_conflicts_resolved(\n    ctx: &mut Context,\n    out: &mut OutputChannel,\n    paths: Vec<String>,\n) -> Result<()> {\n    if matches!(operating_mode(ctx)?.operating_mode, OperatingMode::Edit(_)) {\n        bail!(\"In resolution mode, edit the files and run `but resolve finish` instead.\");\n    }\n    but_api::workspace::resolve_worktree_conflicts(\n        ctx,\n        paths.iter().map(|p| BString::from(p.as_str())).collect(),\n    )?;\n    if let Some(json_out) = out.for_json() {\n        json_out.write_value(serde_json::json!({ \"resolved_files\": paths }))?;\n    } else if let Some(human_out) = out.for_human() {\n        let t = theme::get();\n        for path in &paths {\n            writeln!(\n                human_out,\n                \"{} {}\",\n                t.success.paint(\"✓ Marked as resolved:\"),\n                t.attention.paint(path)\n            )?;\n        }\n    }","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L114-L150","documentation":"Mode guard in mark_worktree_conflicts_resolved: the repository is in Edit (resolution) mode, where conflicts are resolved by editing files and running 'but resolve finish', so direct mark-as-resolved is not allowed in this state.","triggerScenarios":"`but resolve <conflicted-paths>...` executed while `operating_mode(ctx)` reports OperatingMode::Edit.","commonSituations":"Entering resolution mode (via `but resolve <commit>`), then trying to bulk-mark files resolved instead of editing and finishing.","solutions":["Edit the conflicted files in your editor to the desired content","Run `but resolve finish` to complete the resolution","Avoid re-entering `but resolve <paths>` while in resolution mode"],"exampleFix":"// before\nbut resolve src/app.rs          # while in resolution mode\n// after\n$EDITOR src/app.rs\nbut resolve finish","handlingStrategy":"validation","validationCode":"let mode = operating_mode(ctx)?;\nif matches!(mode.operating_mode, OperatingMode::Edit(_)) {\n    eprintln!(\"in resolution mode: edit files then 'but resolve finish'\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = resolve_paths(paths) {\n    if e.to_string().contains(\"In resolution mode\") {\n        eprintln!(\"Finish the active resolution first: 'but resolve finish'\");\n    }\n}","preventionTips":["Check operating mode before issuing resolve commands","Complete or abort the current resolution before starting another","Avoid scripted resolve loops that can run during resolution mode"],"tags":["cli","conflict","state"],"backgroundTag":"invalid-state-transition","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"}