Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Silence not found errors

Mikayla Makic12bdc894a8e
diff --git a/crates/fs/src/repository.rs b/crates/fs/src/repository.rs
index efe3a400926..488262887fd 100644
--- a/crates/fs/src/repository.rs
+++ b/crates/fs/src/repository.rs
@@ -1,5 +1,6 @@
use anyhow::Result;
use collections::HashMap;
+use git2::ErrorCode;
use parking_lot::Mutex;
use rpc::proto;
use serde_derive::{Deserialize, Serialize};
@@ -93,8 +94,17 @@ impl GitRepository for LibGitRepository {
}
fn status(&self, path: &RepoPath) -> Result<Option<GitFileStatus>> {
- let status = self.status_file(path)?;
- Ok(read_status(status))
+ let status = self.status_file(path);
+ match status {
+ Ok(status) => Ok(read_status(status)),
+ Err(e) => {
+ if e.code() == ErrorCode::NotFound {
+ Ok(None)
+ } else {
+ Err(e.into())
+ }
+ }
+ }
}
}