Move git status updates to a background thread #2 (#24722)

Follow-up of https://github.com/zed-industries/zed/pull/24307

Brings back the PR and fixes the issue with the git status not
propagated, if computed too slow.
Now, git repo update
* waits in the background for all `scan_dir` repo status updates and
triggers another status update send afterwards
* ensures that the update sent is reported correctly (`scanning = true`)
if either FS or status scan is running still
* during worktree's git statuses updates, bumps `status_scan_id` to
ensure the repo update is reported to all subscribers

Release Notes:

- Improved project panel's speed in large projects
This commit is contained in:
Kirill Bulatov 2025-02-14 16:47:11 +02:00 committed by GitHub
parent 592e8fbffc
commit 744579ede9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 370 additions and 322 deletions

View file

@ -24,6 +24,7 @@ use std::{
mem,
path::{Path, PathBuf},
sync::Arc,
time::Duration,
};
use util::{test::TempTree, ResultExt};
@ -1504,6 +1505,7 @@ async fn test_bump_mtime_of_git_repo_workdir(cx: &mut TestAppContext) {
&[(Path::new("b/c.txt"), StatusCode::Modified.index())],
);
cx.executor().run_until_parked();
cx.executor().advance_clock(Duration::from_secs(1));
let snapshot = tree.read_with(cx, |tree, _| tree.snapshot());