Made the map seek target a publicly implementable interface

Integrated remove_range with the existing git code

co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Mikayla Maki 2023-05-12 08:37:07 -07:00
parent ee3637216e
commit 6ef0f70528
No known key found for this signature in database
4 changed files with 48 additions and 37 deletions

View file

@ -7,7 +7,7 @@ use client::{proto, Client};
use clock::ReplicaId;
use collections::{HashMap, VecDeque};
use fs::{
repository::{GitFileStatus, GitRepository, RepoPath},
repository::{GitFileStatus, GitRepository, RepoPath, RepoPathDescendants},
Fs, LineEnding,
};
use futures::{
@ -54,7 +54,7 @@ use std::{
},
time::{Duration, SystemTime},
};
use sum_tree::{Bias, Edit, SeekTarget, SumTree, TreeMap, TreeSet, PathDescendants};
use sum_tree::{Bias, Edit, SeekTarget, SumTree, TreeMap, TreeSet};
use util::{paths::HOME, ResultExt, TakeUntilExt, TryFutureExt};
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, PartialOrd, Ord)]
@ -3023,7 +3023,7 @@ impl BackgroundScanner {
snapshot.repository_entries.update(&work_dir, |entry| {
entry
.worktree_statuses
.remove_range(&repo_path, &PathDescendants(&repo_path))
.remove_range(&repo_path, &RepoPathDescendants(&repo_path))
});
}