Remove git repos from worktree when deleted on storage

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Julia 2022-09-27 14:07:53 -04:00
parent 4251e0f5f1
commit d2b18790a0
2 changed files with 50 additions and 20 deletions

View file

@ -56,7 +56,7 @@ impl GitRepository {
self.last_scan_id = scan_id;
}
pub fn with_repo(&mut self, f: Box<dyn FnOnce(&mut git2::Repository)>) {
pub fn with_repo<F: FnOnce(&mut git2::Repository)>(&mut self, f: F) {
let mut git2 = self.libgit_repository.lock();
f(&mut git2)
}