{"record":{"id":"9fa18d169e26d251","repo":"gitbutlerapp/gitbutler","slug":"conflicted-uncommitted-files-can-only-be-marked-as","errorCode":null,"errorMessage":"Conflicted uncommitted files can only be marked as resolved: `but resolve <path>...`","messagePattern":"Conflicted uncommitted files can only be marked as resolved: `but resolve <path>\\.\\.\\.`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":48,"sourceCode":"    ai: bool,\n) -> Result<()> {\n    // Conflicted uncommitted files are marked resolved; anything else is a commit.\n    let conflicted_paths = if targets.is_empty() {\n        Vec::new()\n    } else {\n        conflicted_worktree_paths(ctx)?\n    };\n    let commit_id = match targets.as_slice() {\n        [] => None,\n        [target] if !conflicted_paths.contains(target) => Some(target.clone()),\n        _ => {\n            if let Some(other) = targets.iter().find(|t| !conflicted_paths.contains(t)) {\n                bail!(\n                    \"'{other}' is not a conflicted uncommitted file; `but resolve` takes either one commit or only conflicted files (see `but status`).\"\n                );\n            }\n            if ai {\n                bail!(\n                    \"Conflicted uncommitted files can only be marked as resolved: `but resolve <path>...`\"\n                );\n            }\n            return mark_worktree_conflicts_resolved(ctx, out, targets);\n        }\n    };\n    if ai {\n        if cmd.is_some() {\n            bail!(\n                \"--ai cannot be combined with a resolve subcommand. For one conflict, use `but resolve apply <path>[:<N>] --ai` instead.\"\n            );\n        }\n        return resolve_with_ai(ctx, out, commit_id.as_deref());\n    }\n    match cmd {\n        Some(Subcommands::Conflicts { commit }) => list_conflicts(ctx, out, commit.as_deref()),\n        Some(Subcommands::Apply {\n            target,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L30-L66","documentation":"When all given targets are conflicted uncommitted files, `--ai` cannot be used because AI resolution only works against a commit, not worktree conflicts. The command bails to redirect the user to plain path-based resolution.","triggerScenarios":"`but resolve <conflicted-path>... --ai` where every target is a conflicted uncommitted file.","commonSituations":"Users assume `--ai` works everywhere and append it to a file-based resolve command.","solutions":["Drop `--ai` and run `but resolve <path>...` to mark files resolved manually","If AI help is wanted for a commit's conflict, use `but resolve <commit-id> --ai`"],"exampleFix":"// before\nbut resolve src/app.rs --ai\n// after\nbut resolve src/app.rs","handlingStrategy":"validation","validationCode":"if ai_flag && targets.iter().all(|t| conflicted_paths.contains(t)) {\n    eprintln!(\"--ai cannot be used for worktree-conflicted files; drop --ai\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = run_resolve(args) {\n    if e.to_string().contains(\"--ai\") {\n        eprintln!(\"Remove --ai for path-based resolve, or target a commit instead\");\n    }\n}","preventionTips":["Use `--ai` only with a commit ID target","Keep AI and manual resolve flows separate in scripts","Read `but resolve --help` for flag/subcommand compatibility"],"tags":["cli","conflict","flags"],"backgroundTag":"mutually-exclusive-flags","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"}