Move repository state RPC handlers to the GitStore (#27391)
This is another in the series of PRs to make the GitStore own all repository state and enable better concurrency control for git repository scans. After this PR, the `RepositoryEntry`s stored in worktree snapshots are used only as a staging ground for local GitStores to pull from after git-related events; non-local worktrees don't store them at all, although this is not reflected in the types. GitTraversal and other places that need information about repositories get it from the GitStore. The GitStore also takes over handling of the new UpdateRepository and RemoveRepository messages. However, repositories are still discovered and scanned on a per-worktree basis, and we're still identifying them by the (worktree-specific) project entry ID of their working directory. - [x] Remove WorkDirectory from RepositoryEntry - [x] Remove worktree IDs from repository-related RPC messages - [x] Handle UpdateRepository and RemoveRepository RPCs from the GitStore Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
1e8b50f471
commit
6924720b35
22 changed files with 1387 additions and 1399 deletions
|
@ -2555,6 +2555,9 @@ impl OutlinePanel {
|
|||
let auto_fold_dirs = OutlinePanelSettings::get_global(cx).auto_fold_dirs;
|
||||
let active_multi_buffer = active_editor.read(cx).buffer().clone();
|
||||
let new_entries = self.new_entries_for_fs_update.clone();
|
||||
let repo_snapshots = self.project.update(cx, |project, cx| {
|
||||
project.git_store().read(cx).repo_snapshots(cx)
|
||||
});
|
||||
self.updating_fs_entries = true;
|
||||
self.fs_entries_update_task = cx.spawn_in(window, async move |outline_panel, cx| {
|
||||
if let Some(debounce) = debounce {
|
||||
|
@ -2679,13 +2682,15 @@ impl OutlinePanel {
|
|||
.unwrap_or_default(),
|
||||
entry,
|
||||
};
|
||||
let mut traversal =
|
||||
GitTraversal::new(worktree.traverse_from_path(
|
||||
let mut traversal = GitTraversal::new(
|
||||
&repo_snapshots,
|
||||
worktree.traverse_from_path(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
entry.path.as_ref(),
|
||||
));
|
||||
),
|
||||
);
|
||||
|
||||
let mut entries_to_add = HashMap::default();
|
||||
worktree_excerpts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue