{"record":{"id":"415eb351829dfb8e","repo":"gitbutlerapp/gitbutler","slug":"other-is-not-a-conflicted-uncommitted-file-b","errorCode":null,"errorMessage":"'{other}' is not a conflicted uncommitted file; `but resolve` takes either one commit or only conflicted files (see `but status`).","messagePattern":"'(.+?)' is not a conflicted uncommitted file; `but resolve` takes either one commit or only conflicted files \\(see `but status`\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":43,"sourceCode":"pub(crate) fn handle(\n    ctx: &mut Context,\n    out: &mut OutputChannel,\n    cmd: Option<Subcommands>,\n    targets: Vec<String>,\n    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());","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L25-L61","documentation":"Argument validation in the resolve command handler: a target was supplied that is not a conflicted uncommitted file. 'but resolve' accepts either exactly one commit identifier or only conflicted uncommitted files; this input matched neither category. Run 'but status' to identify valid conflicted files or commit IDs.","triggerScenarios":"`but resolve <path>...` where targets contains a file that is not in the conflicted_paths set (e.g. two paths given, one already resolved or never conflicted).","commonSituations":"Listing a file that was already resolved; misspelling a path; mixing a commit ID and file paths in one invocation.","solutions":["Run `but status` to see which files are currently conflicted","Pass only currently-conflicted paths: `but resolve <conflicted1> <conflicted2>`","If targeting a commit, pass exactly one commit ID and no paths","Note: with a single non-conflicted target the CLI treats it as a commit ID instead of erroring here"],"exampleFix":"// before\nbut resolve src/app.rs src/other.rs   # src/other.rs not conflicted\n// after\nbut resolve src/app.rs                # only conflicted files","handlingStrategy":"validation","validationCode":"let conflicted: HashSet<String> = conflicted_paths.iter().cloned().collect();\nlet ok = targets.len() == 1 || targets.iter().all(|t| conflicted.contains(t));\nif !ok { eprintln!(\"pass only conflicted paths (but status) or exactly one commit\"); }","typeGuard":null,"tryCatchPattern":"if let Err(e) = run_resolve(targets) {\n    if e.to_string().contains(\"is not a conflicted uncommitted file\") {\n        eprintln!(\"Check 'but status' for currently conflicted files\");\n    }\n}","preventionTips":["Always cross-check target paths against `but status` output","Never mix commit IDs and file paths in one resolve invocation","Filter out already-resolved files before invoking"],"tags":["cli","conflict","argument-validation"],"backgroundTag":"invalid-argument-value","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"}