{"record":{"id":"93df4ffd0e774be0","repo":"GitoxideLabs/gitoxide","slug":"err-93df4f","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/merge/tree.rs","lineNumber":103,"sourceCode":"        if message.is_some() && has_unresolved_conflicts {\n            write_unresolved_conflict_paths(err, &res.conflicts)?;\n            if debug {\n                writeln!(err, \"{:#?}\", res.conflicts)?;\n            }\n            bail!(\"Tree conflicted, refusing to write commit\");\n        }\n\n        let tree_id = {\n            let _span = gix::trace::detail!(\"Writing merged tree\");\n            let mut written = 0;\n            let tree_id = res\n                .tree\n                .detach()\n                .write(|tree| {\n                    written += 1;\n                    repo.write(tree)\n                })\n                .map_err(|err| anyhow!(\"{err}\"))?;\n            writeln!(out, \"{tree_id} (wrote {written} trees)\")?;\n            tree_id\n        };\n\n        let conflicts = res.conflicts;\n        if message.is_some() && !in_memory {\n            persist_in_memory_objects(&mut repo)?;\n        }\n\n        if let Some(message) = message {\n            let head_id = repo.head_id()?;\n            let commit_id = if update_head {\n                let commit_id = repo.commit(\"HEAD\", message, tree_id, Some(head_id))?;\n                let mut index = repo.index_from_tree(&tree_id)?;\n                index.write(Default::default())?;\n                commit_id\n            } else {\n                repo.new_commit(message, tree_id, Some(head_id))?.id()","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/merge/tree.rs#L85-L121","documentation":"This is a context-wrapping of an underlying object-write failure in `gix merge tree` CLI handling. After a merge produces in-memory trees, the CLI writes each tree back to the object database via `repo.write(tree)`; any write error (I/O, compression, missing object) is re-raised as `anyhow!(\"{err}\")` losing its type but keeping the message.","triggerScenarios":"Calling the `gix merge tree` CLI (gitoxide-core `repository::merge::tree`) where the merge result tree cannot be written to the object database — e.g. unwritable .git/objects, disk full, or an internal gix::object::write error.","commonSituations":"Running merges in read-only or disk-full environments; permission issues on .git/objects; corrupted object database backends.","solutions":["Check disk space and write permissions on .git/objects","Run the same operation as a user with write access to the repository","Inspect the inner `{err}` message for the root cause from gix::odb::write","Reproduce with a fresh clone to rule out object-store corruption"],"exampleFix":"// before\n.map_err(|err| anyhow!(\"{err}\"))?\n// after\n.map_err(|err| anyhow!(\"failed to write merged tree to object database: {err}\"))?","handlingStrategy":"try-catch","validationCode":"fn can_write_objects(repo: &gix::Repository) -> bool {\n    repo.workdir()\n        .map(|d| d.join(\"objects\").metadata().map(|m| !m.permissions().readonly()).unwrap_or(false))\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Ok(v) => v,\n    Err(e) => { eprintln!(\"tree write failed: {e:#}\"); check_disk_and_permissions(); }\n}","preventionTips":["Check free disk space before large merge operations","Verify .git/objects is writable in CI containers","Prefer running merges on local, non-read-only clones"],"tags":["git","object-database","io","cli"],"backgroundTag":"file-write-failed","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}