Track index instead of head for diffs

This commit is contained in:
Julia 2022-09-29 13:10:39 -04:00
parent 9fe6a5e83e
commit e865b85d9c
3 changed files with 35 additions and 12 deletions

View file

@ -1,7 +1,7 @@
use anyhow::{anyhow, Result};
use fsevent::EventStream;
use futures::{future::BoxFuture, Stream, StreamExt};
use git::repository::{FakeGitRepository, GitRepository, RealGitRepository};
use git::repository::{GitRepository, RealGitRepository};
use language::LineEnding;
use smol::io::{AsyncReadExt, AsyncWriteExt};
use std::{
@ -854,7 +854,10 @@ impl Fs for FakeFs {
}
fn open_repo(&self, abs_dot_git: &Path) -> Option<Box<dyn GitRepository>> {
Some(FakeGitRepository::open(abs_dot_git.into(), 0))
Some(git::repository::FakeGitRepository::open(
abs_dot_git.into(),
0,
))
}
fn is_fake(&self) -> bool {

View file

@ -2603,7 +2603,13 @@ impl BackgroundScanner {
.git_repositories
.iter()
.map(|repo| repo.boxed_clone())
.filter(|repo| git::libgit::Repository::open(repo.git_dir_path()).is_ok())
.filter_map(|mut repo| {
if repo.reopen_git_repo() {
Some(repo)
} else {
None
}
})
.collect();
snapshot.git_repositories = new_repos;