{"record":{"id":"c5caa5ecf982d26c","repo":"gitbutlerapp/gitbutler","slug":"disabled","errorCode":null,"errorMessage":"disabled","messagePattern":"disabled","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-core/src/repo_ext.rs","lineNumber":392,"sourceCode":"                    untracked_items.push(rela_path);\n                }\n                status::Item::IndexWorktree(index_worktree::Item::Modification {\n                    rela_path,\n                    status: EntryStatus::Change(Change::SubmoduleModification(change)),\n                    ..\n                }) => {\n                    if let Some(possibly_changed_head_commit) = change.checked_out_head_id {\n                        head_tree_editor.upsert(\n                            rela_path.as_bstr(),\n                            gix::object::tree::EntryKind::Commit,\n                            possibly_changed_head_commit,\n                        )?;\n                        worktreepaths_changed.insert(rela_path);\n                    }\n                }\n                status::Item::IndexWorktree(index_worktree::Item::Rewrite { .. })\n                | status::Item::TreeIndex(gix::diff::index::Change::Rewrite { .. }) => {\n                    unreachable!(\"disabled\")\n                }\n                status::Item::IndexWorktree(\n                    index_worktree::Item::Modification {\n                        status: EntryStatus::NeedsUpdate(_),\n                        ..\n                    }\n                    | index_worktree::Item::DirectoryContents {\n                        entry:\n                            gix::dir::Entry {\n                                status:\n                                    gix::dir::entry::Status::Tracked\n                                    | gix::dir::entry::Status::Pruned\n                                    | gix::dir::entry::Status::Ignored(_),\n                                ..\n                            },\n                        ..\n                    },\n                ) => {}","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-core/src/repo_ext.rs#L374-L410","documentation":"While rebuilding the HEAD tree across worktrees (but-core/src/repo_ext.rs), `status::Item::IndexWorktree(Rewrite)` and `TreeIndex(Change::Rewrite)` arms are `unreachable!(\"disabled\")` because the status/diff pipeline feeding this loop is constructed with rewrite (rename/copy) detection disabled — rewrites surface as separate deletion+addition changes. The panic means some option set turned rewrite tracking back on.","triggerScenarios":"Building the gix status platform with `rewrite: Some(...)` (rename/copy tracking enabled) and passing its items into this head-tree editor; a refactor or gix default change that flips rewrite emission on for the tree↔index or index↔worktree diff.","commonSituations":"Enabling rename tracking for UI purposes on a code path shared with the snapshot editor; gix dependency upgrades that alter rewrite option defaults; copy-pasting status options from another pipeline.","solutions":["Set rewrite tracking to `None` in the gix diff/status options used to produce items for this loop.","If rewrites must stay enabled upstream, split the pipeline so the editor receives a rewrite-free item stream.","Add a debug assertion/test that the item stream contains no `Rewrite` variants before the match."],"exampleFix":"// before (options feeding the status loop)\nlet mut opts = gix::status::Options::default();\nopts.index_worktree.rewrites = Some(gix::diff::Rewrites::default()); // enables Rewrite items\n\n// after\nlet mut opts = gix::status::Options::default();\nopts.index_worktree.rewrites = None; // Rewrite arms stay unreachable, as designed","handlingStrategy":"validation","validationCode":"// ensure the status feeding the head-tree editor has rewrites off\nlet mut opts = gix::status::Options::default();\nopts.index_worktree.rewrites = None;\nopts.tree_index.rewrites = None;\nlet status = repo.status_with_index_stream(...)?.with_options(opts);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one status/options constructor for snapshot/editor pipelines with rewrites set to None.","Never share a rename-aware diff platform with code matching on status items exhaustively.","Add a debug assertion that the item stream contains no Rewrite variants before the editor loop."],"tags":["rust","but-core","gix","rewrite-detection","status","internal-invariant"],"backgroundTag":"git-rewrite-detection-enabled","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}