{"record":{"id":"763b6f317049400a","repo":"zed-industries/zed","slug":"file-history-changed-files-is-only-supported-local","errorCode":null,"errorMessage":"file history changed files is only supported locally","messagePattern":"file history changed files is only supported locally","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":7050,"sourceCode":"        cx.spawn(|_, _: &mut AsyncApp| async move { rx.await? })\n    }\n\n    fn open_local_commit_buffer(\n        language_registry: Option<Arc<LanguageRegistry>>,\n        buffer_store: Entity<BufferStore>,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<Entity<Buffer>>> {\n        cx.spawn(async move |repository, cx| {\n            let git_commit_language = match language_registry {\n                Some(language_registry) => {\n                    Some(language_registry.language_for_name(\"Git Commit\").await?)\n                }\n                None => None,\n            };\n            let buffer = buffer_store\n                .update(cx, |buffer_store, cx| {\n                    buffer_store.create_buffer(git_commit_language, false, cx)\n                })\n                .await?;\n\n            repository.update(cx, |repository, _| {\n                repository.commit_message_buffer = Some(buffer.clone());\n            })?;\n            Ok(buffer)\n        })\n    }\n\n    pub fn checkout_files(\n        &mut self,\n        commit: &str,\n        paths: Vec<RepoPath>,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<()>> {\n        let commit = commit.to_string();\n        let id = self.id;\n","sourceCodeStart":7032,"sourceCodeEnd":7068,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/project/src/git_store.rs#L7032-L7068","documentation":"Zed's GitStore executes the file_history_changed_files job against the local git backend only (crates/project/src/git_store.rs:7036). In remote development sessions the repository is a RepositoryState::Remote, which has no local backend to compute changed-file sets from, so the job fails immediately rather than returning incorrect history.","triggerScenarios":"Calling GitStore::file_history_changed_files(paths, commit_limit) while the project's repository state is RepositoryState::Remote - i.e. invoking the file-history changed-files feature, or any extension wrapping it, inside an SSH/remote development session.","commonSituations":"Remote (SSH) projects where the worktree lives on the remote host; extensions or custom tooling written against local-only git APIs; local-git code paths reused in remote sessions.","solutions":["Guard the call: only invoke file_history_changed_files when the worktree is local (worktree.read(cx).is_local())","Hide or disable the file-history UI entry point for remote repositories, like other local-only git operations","For remote hosts, run the equivalent git command outside Zed on the remote machine"],"exampleFix":"// before\nlet sets = git_store.file_history_changed_files(paths, commit_limit, cx).await?;\n\n// after\nif worktree.read(cx).is_local() {\n    let sets = git_store.file_history_changed_files(paths, commit_limit, cx).await?;\n}","handlingStrategy":"validation","validationCode":"let is_local = worktree.read(cx).is_local();\nif !is_local {\n    // Skip: local-only git operation on a remote repository\n    return Ok(Vec::new());\n}","typeGuard":"fn is_local_repository(worktree: &Entity<Worktree>, cx: &App) -> bool {\n    worktree.read(cx).is_local()\n}","tryCatchPattern":"match git_store.file_history_changed_files(paths, commit_limit, cx).await {\n    Ok(sets) => { /* ... */ }\n    Err(err) if err.to_string().contains(\"only supported locally\") => {\n        // degrade gracefully in remote sessions instead of propagating\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Check worktree.is_local() before invoking any GitStore job documented as local-only","Treat RepositoryState::Remote as a first-class case when porting local git features to remote projects"],"tags":["git","remote-dev","file-history","unsupported-operation"],"backgroundTag":"remote-unsupported-operation","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"}