{"record":{"id":"d8d619d7695ac69b","repo":"zed-industries/zed","slug":"git-repo-must-have-a-directory-name","errorCode":null,"errorMessage":"git repo must have a directory name","messagePattern":"git repo must have a directory name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":8926,"sourceCode":"        self.send_keyed_job(\n            \"spawn_set_index_text_job\",\n            Some(GitJobKey::WriteIndex(vec![path.clone()])),\n            None,\n            move |git_repo, mut cx| async move {\n                log::debug!(\n                    \"start updating index text for buffer {}\",\n                    path.as_unix_str()\n                );\n\n                match git_repo {\n                    RepositoryState::Local(LocalRepositoryState {\n                        fs,\n                        backend,\n                        environment,\n                        ..\n                    }) => {\n                        let executable = match fs.metadata(&abs_path).await {\n                            Ok(Some(meta)) => meta.is_executable,\n                            Ok(None) => false,\n                            Err(_err) => false,\n                        };\n                        let content =\n                            content.map(|content| encode_text(content, encoding, has_bom));\n                        backend\n                            .set_index_text(path.clone(), content, environment.clone(), executable)\n                            .await?;\n                    }\n                    RepositoryState::Remote(RemoteRepositoryState { project_id, client }) => {\n                        client\n                            .request(proto::SetIndexText {\n                                project_id: project_id.0,\n                                repository_id: id.to_proto(),\n                                path: path.as_unix_str().to_owned(),\n                                text: content,\n                            })\n                            .await?;","sourceCodeStart":8908,"sourceCodeEnd":8944,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/project/src/git_store.rs#L8908-L8944","documentation":"Raised while computing a directory for a new git linked worktree: the repository anchor path (main worktree path or common dir) has no final path component, so no name can be derived for the new worktree directory.","triggerScenarios":"Thrown at crates/project/src/git_store.rs:8912 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the main worktree / common dir path is a normal absolute path with a file name","Check that the git repository metadata isn't corrupted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}