{"record":{"id":"1a2e2ea21cba282a","repo":"zed-industries/zed","slug":"repo-path-from-status-entry-component","errorCode":null,"errorMessage":"repo path from status entry component","messagePattern":"repo path from status entry component","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git_ui/src/git_panel.rs","lineNumber":826,"sourceCode":"    fn covers(&self, depth: usize) -> bool {\n        self.covering_depth\n            .is_some_and(|covering_depth| depth > covering_depth)\n    }\n}\n\nenum GitPanelViewMode {\n    Flat,\n    Tree(TreeViewState),\n}\n\nimpl GitPanelViewMode {\n    fn from_settings(cx: &App) -> Self {\n        if GitPanelSettings::get_global(cx).tree_view {\n            GitPanelViewMode::Tree(TreeViewState::default())\n        } else {\n            GitPanelViewMode::Flat\n        }\n    }\n\n    fn tree_state(&self) -> Option<&TreeViewState> {\n        match self {\n            GitPanelViewMode::Tree(state) => Some(state),\n            GitPanelViewMode::Flat => None,\n        }\n    }\n\n    fn tree_state_mut(&mut self) -> Option<&mut TreeViewState> {\n        match self {\n            GitPanelViewMode::Tree(state) => Some(state),\n            GitPanelViewMode::Flat => None,\n        }\n    }\n}\n\n#[derive(Default)]\nstruct TreeViewState {","sourceCodeStart":808,"sourceCodeEnd":844,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git_ui/src/git_panel.rs#L808-L844","documentation":"A component-conversion guard when building the git panel tree in from_settings: each status entry's repo_path is decomposed into Path components that the code downcasts/expects to be plain str components. The expect fires if a path component is not representable as UTF-8 str (possible on Windows with non-Unicode names, or exotic byte sequences on Unix), meaning the file path from git status cannot be mapped into the panel's String-keyed tree nodes.","triggerScenarios":"Thrown at crates/git_ui/src/git_panel.rs:827 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use to_string_lossy (or filter with to_str()) when converting components so non-UTF-8 paths degrade instead of panicking","Keep tree keys as PathBuf/OsString rather than String to make non-UTF-8 paths representable","Skip entries whose repo_path cannot be converted and log them, leaving the rest of the panel functional"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}