{"record":{"id":"c20dfd3918c08403","repo":"GitoxideLabs/gitoxide","slug":"file-conflicted","errorCode":null,"errorMessage":"File conflicted","messagePattern":"File conflicted","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/merge/file.rs","lineNumber":87,"sourceCode":"            Conflict::ResolveWithUnion => None,\n        };\n    }\n    let platform = cache.prepare_merge(&repo.objects, options)?;\n    let labels = gix::merge::blob::builtin_driver::text::Labels {\n        ancestor: Some(base.as_ref()),\n        current: Some(ours.as_ref()),\n        other: Some(theirs.as_ref()),\n    };\n    let mut buf = repo.empty_reusable_buffer();\n    let (pick, resolution) = platform.merge(&mut buf, labels, &repo.command_context()?)?;\n    let buf = platform\n        .buffer_by_pick(pick)\n        .map_err(|_| anyhow!(\"Participating object was too large\"))?\n        .unwrap_or(&buf);\n    out.write_all(buf)?;\n\n    if resolution == Resolution::Conflict {\n        bail!(\"File conflicted\")\n    }\n    Ok(())\n}\n\nfn worktree_roots(\n    base: Option<gix::Id<'_>>,\n    ours: Option<gix::Id<'_>>,\n    theirs: Option<gix::Id<'_>>,\n    workdir: Option<&Path>,\n) -> anyhow::Result<gix::merge::blob::pipeline::WorktreeRoots> {\n    let roots = if base.is_none() || ours.is_none() || theirs.is_none() {\n        let workdir = workdir.context(\"A workdir is required if one of the bases are provided as path.\")?;\n        gix::merge::blob::pipeline::WorktreeRoots {\n            current_root: ours.is_none().then(|| workdir.to_owned()),\n            other_root: theirs.is_none().then(|| workdir.to_owned()),\n            common_ancestor_root: base.is_none().then(|| workdir.to_owned()),\n        }\n    } else {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/merge/file.rs#L69-L105","documentation":"The file (blob) merge ended in a conflict: the requested `Resolution::Conflict` path was taken, the conflicted buffer is still written to stdout, and then the command bails with `File conflicted` to signal a non-zero exit. This is the intended way for the CLI to report a blob-level conflict.","triggerScenarios":"Running `gix merge file` where the three-way content merge produces conflict markers and `resolution == Resolution::Conflict`; also reachable when buffers are too large (that case raises a different 'Participating object was too large' error).","commonSituations":"Merging versions of a file with overlapping edits; using the command as a custom merge driver in CI; reproducing `git merge-file` semantics with gitoxide.","solutions":["Inspect the conflicted output on stdout and resolve markers manually","Re-run with a resolution option that auto-picks a side if available","Use a different merge driver/strategy for the blob"],"exampleFix":"// before\n$ gix merge file base ours theirs   # exit: File conflicted\n// after: edit the emitted conflict markers, or choose a non-conflict resolution flag\n$ gix merge file base ours theirs --resolution <ours|theirs>","handlingStrategy":"try-catch","validationCode":"// inspect the merge result before treating exit as fatal\nlet conflicted = output.contains(\"<<<<<<<\");\nif conflicted { eprintln!(\"blob merge produced conflict markers\"); }\n","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string() == \"File conflicted\" => {\n        // stdout already contains the conflicted buffer; route to manual resolution\n        1\n    }\n    other => { other?; 0 }\n}\n","preventionTips":["Treat non-zero exit plus stdout content as normal conflict flow, not a crash","Pick merge drivers that suit the content type","Check object sizes to avoid the related too-large failure path"],"tags":["merge","conflict","git"],"backgroundTag":"merge-conflict","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}