gitbutlerapp/gitbutler · error

' ' is not a conflicted uncommitted file; `but resolve`…

Error message

'{other}' is not a conflicted uncommitted file; `but resolve` takes either one commit or only conflicted files (see `but status`).

What it means

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.

Solutions

  1. Run `but status` to see which files are currently conflicted
  2. Pass only currently-conflicted paths: `but resolve <conflicted1> <conflicted2>`
  3. If targeting a commit, pass exactly one commit ID and no paths
  4. Note: with a single non-conflicted target the CLI treats it as a commit ID instead of erroring here

Example fix

// before
but resolve src/app.rs src/other.rs   # src/other.rs not conflicted
// after
but resolve src/app.rs                # only conflicted files
Defensive patterns

Strategy: validation

Validate before calling

let conflicted: HashSet<String> = conflicted_paths.iter().cloned().collect();
let ok = targets.len() == 1 || targets.iter().all(|t| conflicted.contains(t));
if !ok { eprintln!("pass only conflicted paths (but status) or exactly one commit"); }

Try / catch

if let Err(e) = run_resolve(targets) {
    if e.to_string().contains("is not a conflicted uncommitted file") {
        eprintln!("Check 'but status' for currently conflicted files");
    }
}

Prevention

When it happens

Trigger: `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).

Common situations: Listing a file that was already resolved; misspelling a path; mixing a commit ID and file paths in one invocation.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/415eb351829dfb8e. Report an issue: GitHub.

Appendix: source

Thrown at crates/but/src/command/legacy/resolve.rs:43

pub(crate) fn handle(
    ctx: &mut Context,
    out: &mut OutputChannel,
    cmd: Option<Subcommands>,
    targets: Vec<String>,
    ai: bool,
) -> Result<()> {
    // Conflicted uncommitted files are marked resolved; anything else is a commit.
    let conflicted_paths = if targets.is_empty() {
        Vec::new()
    } else {
        conflicted_worktree_paths(ctx)?
    };
    let commit_id = match targets.as_slice() {
        [] => None,
        [target] if !conflicted_paths.contains(target) => Some(target.clone()),
        _ => {
            if let Some(other) = targets.iter().find(|t| !conflicted_paths.contains(t)) {
                bail!(
                    "'{other}' is not a conflicted uncommitted file; `but resolve` takes either one commit or only conflicted files (see `but status`)."
                );
            }
            if ai {
                bail!(
                    "Conflicted uncommitted files can only be marked as resolved: `but resolve <path>...`"
                );
            }
            return mark_worktree_conflicts_resolved(ctx, out, targets);
        }
    };
    if ai {
        if cmd.is_some() {
            bail!(
                "--ai cannot be combined with a resolve subcommand. For one conflict, use `but resolve apply <path>[:<N>] --ai` instead."
            );
        }
        return resolve_with_ai(ctx, out, commit_id.as_deref());

View on GitHub (pinned to 58e5313667)