{"record":{"id":"9976da4a6bfc3612","repo":"zed-industries/zed","slug":"failed-to-find-git-repository-for-buffer","errorCode":null,"errorMessage":"failed to find git repository for buffer","messagePattern":"failed to find git repository for buffer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":1211,"sourceCode":"                                            let update =\n                                                snapshot.build_update(old_snapshot, project_id);\n                                            *old_snapshot = snapshot;\n                                            for update in split_repository_update(update) {\n                                                client.send(update)?;\n                                            }\n                                        } else {\n                                            let update = snapshot.initial_update(project_id);\n                                            for update in split_repository_update(update) {\n                                                client.send(update)?;\n                                            }\n                                            snapshots.insert(snapshot.id, snapshot);\n                                        }\n                                    }\n                                    DownstreamUpdate::RemoveRepository(id) => {\n                                        client.send(proto::RemoveRepository {\n                                            project_id,\n                                            id: id.to_proto(),\n                                        })?;\n                                    }\n                                }\n                            }\n                            anyhow::Ok(())\n                        })\n                        .await\n                        .ok();\n                        this.update(cx, |this, _| {\n                            if let GitStoreState::Local {\n                                downstream: downstream_client,\n                                ..\n                            } = &mut this.state\n                            {\n                                downstream_client.take();\n                            } else {\n                                unreachable!(\"unshared called on remote store\");\n                            }\n                        })","sourceCodeStart":1193,"sourceCodeEnd":1229,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/project/src/git_store.rs#L1193-L1229","documentation":"A git operation on a buffer could not map the buffer to any repository: repository_and_path_for_buffer_id found no git repo containing that buffer's file. The file is outside all known worktree repos (or the repo has not been indexed yet).","triggerScenarios":"Thrown at crates/project/src/git_store.rs:1205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file belongs to a folder opened as a worktree containing a .git directory","If the repo was just added, wait for/git the worktree scan to complete and retry"],"exampleFix":null,"handlingStrategy":"fallback","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"}