mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
Don't call git status when ignored files change
This commit is contained in:
parent
4bd415f2b6
commit
05b161118c
2 changed files with 13 additions and 8 deletions
|
@ -109,6 +109,7 @@ impl GitRepository for LibGitRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn branches(&self) -> Result<Vec<Branch>> {
|
fn branches(&self) -> Result<Vec<Branch>> {
|
||||||
let local_branches = self.branches(Some(BranchType::Local))?;
|
let local_branches = self.branches(Some(BranchType::Local))?;
|
||||||
let valid_branches = local_branches
|
let valid_branches = local_branches
|
||||||
|
|
|
@ -2162,10 +2162,12 @@ impl BackgroundScannerState {
|
||||||
let path = entry.path.clone();
|
let path = entry.path.clone();
|
||||||
let ignore_stack = self.snapshot.ignore_stack_for_abs_path(&abs_path, true);
|
let ignore_stack = self.snapshot.ignore_stack_for_abs_path(&abs_path, true);
|
||||||
let mut ancestor_inodes = self.snapshot.ancestor_inodes_for_path(&path);
|
let mut ancestor_inodes = self.snapshot.ancestor_inodes_for_path(&path);
|
||||||
let containing_repository = self
|
let mut containing_repository = None;
|
||||||
.snapshot
|
if !ignore_stack.is_all() {
|
||||||
.local_repo_for_path(&path)
|
if let Some((workdir_path, repo)) = self.snapshot.local_repo_for_path(&path) {
|
||||||
.map(|(path, repo)| (path, repo.repo_ptr.lock().statuses()));
|
containing_repository = Some((workdir_path, repo.repo_ptr.lock().statuses()));
|
||||||
|
}
|
||||||
|
}
|
||||||
if !ancestor_inodes.contains(&entry.inode) {
|
if !ancestor_inodes.contains(&entry.inode) {
|
||||||
ancestor_inodes.insert(entry.inode);
|
ancestor_inodes.insert(entry.inode);
|
||||||
scan_job_tx
|
scan_job_tx
|
||||||
|
@ -3517,10 +3519,12 @@ impl BackgroundScanner {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
child_entry.is_ignored = ignore_stack.is_abs_path_ignored(&child_abs_path, false);
|
child_entry.is_ignored = ignore_stack.is_abs_path_ignored(&child_abs_path, false);
|
||||||
|
if !child_entry.is_ignored {
|
||||||
if let Some((repository_dir, statuses)) = &job.containing_repository {
|
if let Some((repository_dir, statuses)) = &job.containing_repository {
|
||||||
if let Ok(repo_path) = child_entry.path.strip_prefix(&repository_dir.0) {
|
if let Ok(repo_path) = child_entry.path.strip_prefix(&repository_dir.0) {
|
||||||
child_entry.git_status = statuses.get(&RepoPath(repo_path.into())).copied();
|
let repo_path = RepoPath(repo_path.into());
|
||||||
|
child_entry.git_status = statuses.get(&repo_path).copied();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue