{"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":"exception","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/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/resolve.rs#L114-L150","documentation":"When the workspace is in resolution (edit) mode — an active `but resolve <commit>` session — conflicted uncommitted files are managed inside that session. `mark_worktree_conflicts_resolved` checks `OperatingMode::Edit` (resolve.rs:131-133) and refuses ad-hoc marking, telling you to edit the files and conclude with `but resolve finish` so the session's bookkeeping stays consistent.","triggerScenarios":"Running `but resolve <paths>...` (the mark-resolved form) while a resolution session is still open — started earlier with `but resolve <commit>` and neither finished nor cancelled.","commonSituations":"Forgetting an earlier `but resolve <commit>` invocation; a session left open after an interrupted conflict workflow; automation hitting a workspace mid-session.","solutions":["Edit the conflicted files, then run `but resolve finish` to complete the session.","If you want out of the session instead, run `but resolve cancel` (add `--force` if it warns about dropping your edits).","Retry plain `but resolve <paths>` only after the session is finished or cancelled."],"exampleFix":"# before\nbut resolve src/lib.rs   # while a resolution session is open -> refused\n\n# after\n# edit src/lib.rs to resolve the conflict markers, then\nbut resolve finish","handlingStrategy":"validation","validationCode":"# If a resolve session is open, close it before ad-hoc conflict marking\nbut resolve finish 2>/dev/null || but resolve cancel\nbut resolve '<path>'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Finish (`but resolve finish`) or cancel (`but resolve cancel`) sessions before ad-hoc conflict marking.","In resolution mode, always edit files and finish — never mix the two flows."],"tags":["cli","resolve","session-state","conflict","gitbutler"],"backgroundTag":"invalid-operation-state","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}