{"record":{"id":"93acc9af04fcea15","repo":"GitoxideLabs/gitoxide","slug":"cannot-create-a-commit-with-unresolved-index-confl","errorCode":null,"errorMessage":"cannot create a commit with unresolved index conflicts","messagePattern":"cannot create a commit with unresolved index conflicts","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/create.rs","lineNumber":108,"sourceCode":"        .context(\"could not resolve commit signing configuration\")?;\n\n    repo = repo.with_object_memory();\n    let baseline = match parent {\n        Some(id) => repo\n            .find_commit(id)\n            .context(\"could not find the parent commit\")?\n            .tree()\n            .context(\"could not load the parent tree\")?,\n        None => repo.empty_tree(),\n    };\n    let baseline_id = baseline.id;\n    let index = repo.index_or_empty().context(\"could not load the index\")?;\n    if index\n        .entries()\n        .iter()\n        .any(|entry| entry.stage() != gix::index::entry::Stage::Unconflicted)\n    {\n        anyhow::bail!(\"cannot create a commit with unresolved index conflicts\");\n    }\n    let index_tree = index_tree(&repo, &index)?;\n    let based_on_parent = head_id == parent;\n    let tree = if empty || !based_on_parent {\n        baseline.id\n    } else {\n        match source {\n            Source::Default if index_tree != baseline.id => index_tree,\n            Source::Default | Source::Worktree => worktree_tree_tracked(&repo, &baseline, &index)?,\n            Source::Index => index_tree,\n            Source::WorktreeUntracked => worktree_tree(&repo, &baseline)?,\n        }\n    };\n\n    let new_tree = repo.find_tree(tree).context(\"could not load the candidate tree\")?;\n    let mut changes = load_tree_changes_without_lines(\n        &repo,\n        parent.map(|_| &baseline),","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/create.rs#L90-L126","documentation":"The Git index still contains entries from an unresolved merge conflict (entries at stages other than Unconflicted). tix refuses to build a tree or create a commit from such an index, because committing conflicted index state would produce a broken commit. The conflict must be resolved and staged first.","triggerScenarios":"Calling `prepare`/`prepare_empty`/`prepare_from` (via `prepare_inner`) when `repo.index_or_empty()` contains any entry whose `stage() != Stage::Unconflicted`, i.e. mid-merge/rebase/cherry-pick with conflicts unresolved.","commonSituations":"Attempting `tix edit`/create during an interrupted merge or rebase; a previous `git merge` left conflicts and the user forgot to `git add` resolved files; automation resuming operations after a conflict abort.","solutions":["Resolve the conflicts in the worktree and stage the resolved files (`git add <paths>` or `tix` staging equivalent), then retry.","Abort the in-progress merge/rebase (`git merge --abort` / `git rebase --abort`) and redo the operation on a clean state.","Check `git status` for unmerged paths before running the command."],"exampleFix":"// guard before calling\nlet index = repo.index_or_empty()?;\nif index.entries().iter().any(|e| e.stage() != gix::index::entry::Stage::Unconflicted) {\n    anyhow::bail!(\"resolve conflicts before editing\");\n}\ncreate::prepare(&repo, Some(head_id), ...)?;","handlingStrategy":"validation","validationCode":"let index = repo.index_or_empty()?;\nlet conflicted = index.entries().iter()\n    .any(|e| e.stage() != gix::index::entry::Stage::Unconflicted);\nif conflicted {\n    anyhow::bail!(\"resolve and stage all conflicts before committing\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unresolved index conflicts\") => {\n        eprintln!(\"run: git status  # resolve Unmerged paths, then retry\");\n    }\n    other => other?,\n}","preventionTips":["Check `git status` for 'Unmerged paths' before any commit-producing tix command.","Always `git add` resolved files after a conflict.","Ensure merges/rebases are completed or aborted before running edit operations."],"tags":["git","merge-conflict","index"],"backgroundTag":"unresolved-index-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"}