{"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":8912,"sourceCode":"    pub fn linked_worktree_path(&self) -> Option<&Arc<Path>> {\n        self.snapshot\n            .is_linked_worktree()\n            .then_some(&self.work_directory_abs_path)\n    }\n\n    pub fn path_for_new_linked_worktree(\n        &self,\n        branch_name: &str,\n        worktree_directory_setting: &str,\n    ) -> Result<PathBuf> {\n        let repository_anchor = self\n            .snapshot\n            .main_worktree_abs_path()\n            .unwrap_or(self.common_dir_abs_path.as_ref());\n        let project_name = repository_anchor\n            .file_name()\n            .and_then(|name| name.to_str())\n            .ok_or_else(|| anyhow!(\"git repo must have a directory name\"))?;\n        let directory = worktrees_directory_for_repo(\n            repository_anchor,\n            worktree_directory_setting,\n            self.path_style,\n        )?;\n        let directory = self.path_style.join_path(&directory, branch_name)?;\n        self.path_style.join_path(&directory, project_name)\n    }\n\n    pub fn worktrees(&mut self) -> oneshot::Receiver<Result<Vec<GitWorktree>>> {\n        let id = self.id;\n        self.send_job(\"worktrees\", None, move |repo, _| async move {\n            match repo {\n                RepositoryState::Local(LocalRepositoryState { backend, .. }) => {\n                    backend.worktrees().await\n                }\n                RepositoryState::Remote(RemoteRepositoryState { project_id, client }) => {\n                    let response = client","sourceCodeStart":8894,"sourceCodeEnd":8930,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/project/src/git_store.rs#L8894-L8930","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":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}