Compare commits
2 commits
main
...
improve-gi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0ae31d0dc7 | ||
![]() |
31a4f6d411 |
4 changed files with 87 additions and 61 deletions
|
@ -2570,8 +2570,8 @@ impl OutlinePanel {
|
||||||
let auto_fold_dirs = OutlinePanelSettings::get_global(cx).auto_fold_dirs;
|
let auto_fold_dirs = OutlinePanelSettings::get_global(cx).auto_fold_dirs;
|
||||||
let active_multi_buffer = active_editor.read(cx).buffer().clone();
|
let active_multi_buffer = active_editor.read(cx).buffer().clone();
|
||||||
let new_entries = self.new_entries_for_fs_update.clone();
|
let new_entries = self.new_entries_for_fs_update.clone();
|
||||||
let repo_snapshots = self.project.update(cx, |project, cx| {
|
let snapshots_by_abs_path = self.project.update(cx, |project, cx| {
|
||||||
project.git_store().read(cx).repo_snapshots(cx)
|
project.git_store().read(cx).repo_snapshots_by_path(cx)
|
||||||
});
|
});
|
||||||
self.updating_fs_entries = true;
|
self.updating_fs_entries = true;
|
||||||
self.fs_entries_update_task = cx.spawn_in(window, async move |outline_panel, cx| {
|
self.fs_entries_update_task = cx.spawn_in(window, async move |outline_panel, cx| {
|
||||||
|
@ -2698,7 +2698,7 @@ impl OutlinePanel {
|
||||||
entry,
|
entry,
|
||||||
};
|
};
|
||||||
let mut traversal = GitTraversal::new(
|
let mut traversal = GitTraversal::new(
|
||||||
&repo_snapshots,
|
&snapshots_by_abs_path,
|
||||||
worktree.traverse_from_path(
|
worktree.traverse_from_path(
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -48,7 +48,7 @@ use rpc::{
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
collections::{BTreeSet, VecDeque},
|
collections::{BTreeMap, BTreeSet, VecDeque},
|
||||||
future::Future,
|
future::Future,
|
||||||
mem,
|
mem,
|
||||||
ops::Range,
|
ops::Range,
|
||||||
|
@ -72,6 +72,7 @@ pub struct GitStore {
|
||||||
buffer_store: Entity<BufferStore>,
|
buffer_store: Entity<BufferStore>,
|
||||||
worktree_store: Entity<WorktreeStore>,
|
worktree_store: Entity<WorktreeStore>,
|
||||||
repositories: HashMap<RepositoryId, Entity<Repository>>,
|
repositories: HashMap<RepositoryId, Entity<Repository>>,
|
||||||
|
repositories_by_abs_root_path: BTreeMap<Arc<Path>, Entity<Repository>>,
|
||||||
active_repo_id: Option<RepositoryId>,
|
active_repo_id: Option<RepositoryId>,
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
loading_diffs:
|
loading_diffs:
|
||||||
|
@ -400,6 +401,7 @@ impl GitStore {
|
||||||
buffer_store,
|
buffer_store,
|
||||||
worktree_store,
|
worktree_store,
|
||||||
repositories: HashMap::default(),
|
repositories: HashMap::default(),
|
||||||
|
repositories_by_abs_root_path: BTreeMap::default(),
|
||||||
active_repo_id: None,
|
active_repo_id: None,
|
||||||
_subscriptions,
|
_subscriptions,
|
||||||
loading_diffs: HashMap::default(),
|
loading_diffs: HashMap::default(),
|
||||||
|
@ -1193,23 +1195,35 @@ impl GitStore {
|
||||||
) {
|
) {
|
||||||
let mut removed_ids = Vec::new();
|
let mut removed_ids = Vec::new();
|
||||||
for update in updated_git_repositories.iter() {
|
for update in updated_git_repositories.iter() {
|
||||||
if let Some((id, existing)) = self.repositories.iter().find(|(_, repo)| {
|
let existing_repo = update
|
||||||
let existing_work_directory_abs_path =
|
.old_work_directory_abs_path
|
||||||
repo.read(cx).work_directory_abs_path.clone();
|
.as_ref()
|
||||||
Some(&existing_work_directory_abs_path)
|
.and_then(|k| self.repositories_by_abs_root_path.get(k))
|
||||||
== update.old_work_directory_abs_path.as_ref()
|
.or_else(|| {
|
||||||
|| Some(&existing_work_directory_abs_path)
|
update
|
||||||
== update.new_work_directory_abs_path.as_ref()
|
.new_work_directory_abs_path
|
||||||
}) {
|
.as_ref()
|
||||||
|
.and_then(|k| self.repositories_by_abs_root_path.get(k))
|
||||||
|
});
|
||||||
|
if let Some(existing) = existing_repo {
|
||||||
if let Some(new_work_directory_abs_path) =
|
if let Some(new_work_directory_abs_path) =
|
||||||
update.new_work_directory_abs_path.clone()
|
update.new_work_directory_abs_path.clone()
|
||||||
{
|
{
|
||||||
existing.update(cx, |existing, cx| {
|
let old_path = existing.update(cx, |existing, cx| {
|
||||||
existing.snapshot.work_directory_abs_path = new_work_directory_abs_path;
|
let old_path = std::mem::replace(
|
||||||
|
&mut existing.snapshot.work_directory_abs_path,
|
||||||
|
new_work_directory_abs_path.clone(),
|
||||||
|
);
|
||||||
|
|
||||||
existing.schedule_scan(updates_tx.clone(), cx);
|
existing.schedule_scan(updates_tx.clone(), cx);
|
||||||
|
old_path
|
||||||
});
|
});
|
||||||
|
let existing = existing.clone();
|
||||||
|
self.repositories_by_abs_root_path.remove(&old_path);
|
||||||
|
self.repositories_by_abs_root_path
|
||||||
|
.insert(new_work_directory_abs_path, existing);
|
||||||
} else {
|
} else {
|
||||||
removed_ids.push(*id);
|
removed_ids.push(existing.read(cx).id);
|
||||||
}
|
}
|
||||||
} else if let UpdatedGitRepository {
|
} else if let UpdatedGitRepository {
|
||||||
new_work_directory_abs_path: Some(work_directory_abs_path),
|
new_work_directory_abs_path: Some(work_directory_abs_path),
|
||||||
|
@ -1240,7 +1254,9 @@ impl GitStore {
|
||||||
.push(cx.subscribe(&repo, Self::on_repository_event));
|
.push(cx.subscribe(&repo, Self::on_repository_event));
|
||||||
self._subscriptions
|
self._subscriptions
|
||||||
.push(cx.subscribe(&repo, Self::on_jobs_updated));
|
.push(cx.subscribe(&repo, Self::on_jobs_updated));
|
||||||
self.repositories.insert(id, repo);
|
self.repositories.insert(id, repo.clone());
|
||||||
|
self.repositories_by_abs_root_path
|
||||||
|
.insert(work_directory_abs_path.clone(), repo);
|
||||||
cx.emit(GitStoreEvent::RepositoryAdded(id));
|
cx.emit(GitStoreEvent::RepositoryAdded(id));
|
||||||
self.active_repo_id.get_or_insert_with(|| {
|
self.active_repo_id.get_or_insert_with(|| {
|
||||||
cx.emit(GitStoreEvent::ActiveRepositoryChanged(Some(id)));
|
cx.emit(GitStoreEvent::ActiveRepositoryChanged(Some(id)));
|
||||||
|
@ -1254,7 +1270,11 @@ impl GitStore {
|
||||||
self.active_repo_id = None;
|
self.active_repo_id = None;
|
||||||
cx.emit(GitStoreEvent::ActiveRepositoryChanged(None));
|
cx.emit(GitStoreEvent::ActiveRepositoryChanged(None));
|
||||||
}
|
}
|
||||||
self.repositories.remove(&id);
|
let repo = self.repositories.remove(&id);
|
||||||
|
if let Some(repo) = repo {
|
||||||
|
self.repositories_by_abs_root_path
|
||||||
|
.remove(&repo.read(cx).work_directory_abs_path);
|
||||||
|
}
|
||||||
if let Some(updates_tx) = updates_tx.as_ref() {
|
if let Some(updates_tx) = updates_tx.as_ref() {
|
||||||
updates_tx
|
updates_tx
|
||||||
.unbounded_send(DownstreamUpdate::RemoveRepository(id))
|
.unbounded_send(DownstreamUpdate::RemoveRepository(id))
|
||||||
|
@ -1413,13 +1433,14 @@ impl GitStore {
|
||||||
cx: &App,
|
cx: &App,
|
||||||
) -> Option<(Entity<Repository>, RepoPath)> {
|
) -> Option<(Entity<Repository>, RepoPath)> {
|
||||||
let abs_path = self.worktree_store.read(cx).absolutize(path, cx)?;
|
let abs_path = self.worktree_store.read(cx).absolutize(path, cx)?;
|
||||||
self.repositories
|
let range: Range<Arc<Path>> = Arc::from("".as_ref())..Arc::from(abs_path.as_ref());
|
||||||
.values()
|
self.repositories_by_abs_root_path
|
||||||
.filter_map(|repo| {
|
.range(range)
|
||||||
|
.last()
|
||||||
|
.and_then(|(_, repo)| {
|
||||||
let repo_path = repo.read(cx).abs_path_to_repo_path(&abs_path)?;
|
let repo_path = repo.read(cx).abs_path_to_repo_path(&abs_path)?;
|
||||||
Some((repo.clone(), repo_path))
|
Some((repo.clone(), repo_path))
|
||||||
})
|
})
|
||||||
.max_by_key(|(repo, _)| repo.read(cx).work_directory_abs_path.clone())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn git_init(
|
pub fn git_init(
|
||||||
|
@ -2190,6 +2211,13 @@ impl GitStore {
|
||||||
.map(|(id, repo)| (*id, repo.read(cx).snapshot.clone()))
|
.map(|(id, repo)| (*id, repo.read(cx).snapshot.clone()))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn repo_snapshots_by_path(&self, cx: &App) -> BTreeMap<Arc<Path>, RepositorySnapshot> {
|
||||||
|
self.repositories_by_abs_root_path
|
||||||
|
.iter()
|
||||||
|
.map(|(path, repo)| (path.clone(), repo.read(cx).snapshot.clone()))
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BufferGitState {
|
impl BufferGitState {
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
use collections::HashMap;
|
|
||||||
use git::status::GitSummary;
|
use git::status::GitSummary;
|
||||||
use std::{ops::Deref, path::Path};
|
use std::{
|
||||||
|
collections::BTreeMap,
|
||||||
|
ops::{Deref, Range},
|
||||||
|
path::Path,
|
||||||
|
sync::Arc,
|
||||||
|
};
|
||||||
use sum_tree::Cursor;
|
use sum_tree::Cursor;
|
||||||
use text::Bias;
|
use text::Bias;
|
||||||
use worktree::{Entry, PathProgress, PathTarget, Traversal};
|
use worktree::{Entry, PathProgress, PathTarget, Traversal};
|
||||||
|
@ -11,18 +15,18 @@ use super::{RepositoryId, RepositorySnapshot, StatusEntry};
|
||||||
pub struct GitTraversal<'a> {
|
pub struct GitTraversal<'a> {
|
||||||
traversal: Traversal<'a>,
|
traversal: Traversal<'a>,
|
||||||
current_entry_summary: Option<GitSummary>,
|
current_entry_summary: Option<GitSummary>,
|
||||||
repo_snapshots: &'a HashMap<RepositoryId, RepositorySnapshot>,
|
snapshots_by_abs_path: &'a BTreeMap<Arc<Path>, RepositorySnapshot>,
|
||||||
repo_location: Option<(RepositoryId, Cursor<'a, StatusEntry, PathProgress<'a>>)>,
|
repo_location: Option<(RepositoryId, Cursor<'a, StatusEntry, PathProgress<'a>>)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> GitTraversal<'a> {
|
impl<'a> GitTraversal<'a> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
repo_snapshots: &'a HashMap<RepositoryId, RepositorySnapshot>,
|
snapshots_by_abs_path: &'a BTreeMap<Arc<Path>, RepositorySnapshot>,
|
||||||
traversal: Traversal<'a>,
|
traversal: Traversal<'a>,
|
||||||
) -> GitTraversal<'a> {
|
) -> GitTraversal<'a> {
|
||||||
let mut this = GitTraversal {
|
let mut this = GitTraversal {
|
||||||
traversal,
|
traversal,
|
||||||
repo_snapshots,
|
snapshots_by_abs_path,
|
||||||
current_entry_summary: None,
|
current_entry_summary: None,
|
||||||
repo_location: None,
|
repo_location: None,
|
||||||
};
|
};
|
||||||
|
@ -42,14 +46,15 @@ impl<'a> GitTraversal<'a> {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some((repo, repo_path)) = self
|
let range: Range<Arc<Path>> = Arc::from("".as_ref())..Arc::from(abs_path.as_ref());
|
||||||
.repo_snapshots
|
let Some((repo, repo_path)) =
|
||||||
.values()
|
self.snapshots_by_abs_path
|
||||||
.filter_map(|repo_snapshot| {
|
.range(range)
|
||||||
let repo_path = repo_snapshot.abs_path_to_repo_path(&abs_path)?;
|
.last()
|
||||||
Some((repo_snapshot, repo_path))
|
.and_then(|(_, repo)| {
|
||||||
})
|
let repo_path = repo.abs_path_to_repo_path(&abs_path)?;
|
||||||
.max_by_key(|(repo, _)| repo.work_directory_abs_path.clone())
|
Some((repo, repo_path))
|
||||||
|
})
|
||||||
else {
|
else {
|
||||||
self.repo_location = None;
|
self.repo_location = None;
|
||||||
return;
|
return;
|
||||||
|
@ -145,12 +150,12 @@ pub struct ChildEntriesGitIter<'a> {
|
||||||
|
|
||||||
impl<'a> ChildEntriesGitIter<'a> {
|
impl<'a> ChildEntriesGitIter<'a> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
repo_snapshots: &'a HashMap<RepositoryId, RepositorySnapshot>,
|
snapshots_by_abs_path: &'a BTreeMap<Arc<Path>, RepositorySnapshot>,
|
||||||
worktree_snapshot: &'a worktree::Snapshot,
|
worktree_snapshot: &'a worktree::Snapshot,
|
||||||
parent_path: &'a Path,
|
parent_path: &'a Path,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let mut traversal = GitTraversal::new(
|
let mut traversal = GitTraversal::new(
|
||||||
repo_snapshots,
|
snapshots_by_abs_path,
|
||||||
worktree_snapshot.traverse_from_path(true, true, true, parent_path),
|
worktree_snapshot.traverse_from_path(true, true, true, parent_path),
|
||||||
);
|
);
|
||||||
traversal.advance();
|
traversal.advance();
|
||||||
|
@ -310,7 +315,7 @@ mod tests {
|
||||||
|
|
||||||
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
||||||
(
|
(
|
||||||
project.git_store().read(cx).repo_snapshots(cx),
|
project.git_store().read(cx).repo_snapshots_by_path(cx),
|
||||||
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
@ -385,7 +390,7 @@ mod tests {
|
||||||
|
|
||||||
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
||||||
(
|
(
|
||||||
project.git_store().read(cx).repo_snapshots(cx),
|
project.git_store().read(cx).repo_snapshots_by_path(cx),
|
||||||
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
@ -511,7 +516,7 @@ mod tests {
|
||||||
|
|
||||||
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
||||||
(
|
(
|
||||||
project.git_store().read(cx).repo_snapshots(cx),
|
project.git_store().read(cx).repo_snapshots_by_path(cx),
|
||||||
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
@ -620,7 +625,7 @@ mod tests {
|
||||||
|
|
||||||
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
||||||
(
|
(
|
||||||
project.git_store().read(cx).repo_snapshots(cx),
|
project.git_store().read(cx).repo_snapshots_by_path(cx),
|
||||||
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
@ -748,7 +753,7 @@ mod tests {
|
||||||
|
|
||||||
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
let (repo_snapshots, worktree_snapshot) = project.read_with(cx, |project, cx| {
|
||||||
(
|
(
|
||||||
project.git_store().read(cx).repo_snapshots(cx),
|
project.git_store().read(cx).repo_snapshots_by_path(cx),
|
||||||
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
project.worktrees(cx).next().unwrap().read(cx).snapshot(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
@ -766,7 +771,7 @@ mod tests {
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
fn check_git_statuses(
|
fn check_git_statuses(
|
||||||
repo_snapshots: &HashMap<RepositoryId, RepositorySnapshot>,
|
repo_snapshots: &std::collections::BTreeMap<Arc<Path>, RepositorySnapshot>,
|
||||||
worktree_snapshot: &worktree::Snapshot,
|
worktree_snapshot: &worktree::Snapshot,
|
||||||
expected_statuses: &[(&Path, GitSummary)],
|
expected_statuses: &[(&Path, GitSummary)],
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -1806,11 +1806,11 @@ impl ProjectPanel {
|
||||||
let parent_entry = worktree.entry_for_path(parent_path)?;
|
let parent_entry = worktree.entry_for_path(parent_path)?;
|
||||||
|
|
||||||
// Remove all siblings that are being deleted except the last marked entry
|
// Remove all siblings that are being deleted except the last marked entry
|
||||||
let repo_snapshots = git_store.repo_snapshots(cx);
|
let snapshots_by_root_path = git_store.repo_snapshots_by_path(cx);
|
||||||
let worktree_snapshot = worktree.snapshot();
|
let worktree_snapshot = worktree.snapshot();
|
||||||
let hide_gitignore = ProjectPanelSettings::get_global(cx).hide_gitignore;
|
let hide_gitignore = ProjectPanelSettings::get_global(cx).hide_gitignore;
|
||||||
let mut siblings: Vec<_> =
|
let mut siblings: Vec<_> =
|
||||||
ChildEntriesGitIter::new(&repo_snapshots, &worktree_snapshot, parent_path)
|
ChildEntriesGitIter::new(&snapshots_by_root_path, &worktree_snapshot, parent_path)
|
||||||
.filter(|sibling| {
|
.filter(|sibling| {
|
||||||
(sibling.id == latest_entry.id)
|
(sibling.id == latest_entry.id)
|
||||||
|| (!marked_entries_in_worktree.contains(&&SelectedEntry {
|
|| (!marked_entries_in_worktree.contains(&&SelectedEntry {
|
||||||
|
@ -2858,7 +2858,8 @@ impl ProjectPanel {
|
||||||
let auto_collapse_dirs = settings.auto_fold_dirs;
|
let auto_collapse_dirs = settings.auto_fold_dirs;
|
||||||
let hide_gitignore = settings.hide_gitignore;
|
let hide_gitignore = settings.hide_gitignore;
|
||||||
let project = self.project.read(cx);
|
let project = self.project.read(cx);
|
||||||
let repo_snapshots = project.git_store().read(cx).repo_snapshots(cx);
|
let git_store = project.git_store().read(cx);
|
||||||
|
let snapshots_by_root_path = git_store.repo_snapshots_by_path(cx);
|
||||||
self.last_worktree_root_id = project
|
self.last_worktree_root_id = project
|
||||||
.visible_worktrees(cx)
|
.visible_worktrees(cx)
|
||||||
.next_back()
|
.next_back()
|
||||||
|
@ -2903,7 +2904,7 @@ impl ProjectPanel {
|
||||||
|
|
||||||
let mut visible_worktree_entries = Vec::new();
|
let mut visible_worktree_entries = Vec::new();
|
||||||
let mut entry_iter =
|
let mut entry_iter =
|
||||||
GitTraversal::new(&repo_snapshots, worktree_snapshot.entries(true, 0));
|
GitTraversal::new(&snapshots_by_root_path, worktree_snapshot.entries(true, 0));
|
||||||
let mut auto_folded_ancestors = vec![];
|
let mut auto_folded_ancestors = vec![];
|
||||||
while let Some(entry) = entry_iter.entry() {
|
while let Some(entry) = entry_iter.entry() {
|
||||||
if hide_root && Some(entry.entry) == worktree.read(cx).root_entry() {
|
if hide_root && Some(entry.entry) == worktree.read(cx).root_entry() {
|
||||||
|
@ -3503,16 +3504,12 @@ impl ProjectPanel {
|
||||||
.cloned();
|
.cloned();
|
||||||
}
|
}
|
||||||
|
|
||||||
let repo_snapshots = self
|
let git_store = self.project.read(cx).git_store().read(cx);
|
||||||
.project
|
let snapshots_by_root_path = git_store.repo_snapshots_by_path(cx);
|
||||||
.read(cx)
|
|
||||||
.git_store()
|
|
||||||
.read(cx)
|
|
||||||
.repo_snapshots(cx);
|
|
||||||
let worktree = self.project.read(cx).worktree_for_id(worktree_id, cx)?;
|
let worktree = self.project.read(cx).worktree_for_id(worktree_id, cx)?;
|
||||||
worktree.read_with(cx, |tree, _| {
|
worktree.read_with(cx, |tree, _| {
|
||||||
utils::ReversibleIterable::new(
|
utils::ReversibleIterable::new(
|
||||||
GitTraversal::new(&repo_snapshots, tree.entries(true, 0usize)),
|
GitTraversal::new(&snapshots_by_root_path, tree.entries(true, 0usize)),
|
||||||
reverse_search,
|
reverse_search,
|
||||||
)
|
)
|
||||||
.find_single_ended(|ele| predicate(*ele, worktree_id))
|
.find_single_ended(|ele| predicate(*ele, worktree_id))
|
||||||
|
@ -3532,12 +3529,8 @@ impl ProjectPanel {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(worktree_id, _, _)| *worktree_id)
|
.map(|(worktree_id, _, _)| *worktree_id)
|
||||||
.collect();
|
.collect();
|
||||||
let repo_snapshots = self
|
let git_store = self.project.read(cx).git_store().read(cx);
|
||||||
.project
|
let snapshots_by_root_path = git_store.repo_snapshots_by_path(cx);
|
||||||
.read(cx)
|
|
||||||
.git_store()
|
|
||||||
.read(cx)
|
|
||||||
.repo_snapshots(cx);
|
|
||||||
|
|
||||||
let mut last_found: Option<SelectedEntry> = None;
|
let mut last_found: Option<SelectedEntry> = None;
|
||||||
|
|
||||||
|
@ -3554,7 +3547,7 @@ impl ProjectPanel {
|
||||||
let tree_id = worktree.id();
|
let tree_id = worktree.id();
|
||||||
|
|
||||||
let mut first_iter = GitTraversal::new(
|
let mut first_iter = GitTraversal::new(
|
||||||
&repo_snapshots,
|
&snapshots_by_root_path,
|
||||||
worktree.traverse_from_path(true, true, true, entry.path.as_ref()),
|
worktree.traverse_from_path(true, true, true, entry.path.as_ref()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -3570,7 +3563,7 @@ impl ProjectPanel {
|
||||||
.map(|ele| ele.to_owned());
|
.map(|ele| ele.to_owned());
|
||||||
|
|
||||||
let second_iter =
|
let second_iter =
|
||||||
GitTraversal::new(&repo_snapshots, worktree.entries(true, 0usize));
|
GitTraversal::new(&snapshots_by_root_path, worktree.entries(true, 0usize));
|
||||||
|
|
||||||
let second = if reverse_search {
|
let second = if reverse_search {
|
||||||
second_iter
|
second_iter
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue