Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
git: Clear set of dirty paths when doing a full status scan (#36181)
Cole Miller1a169e0b1680
diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rsindex 32deb0dbc4f..3163a10239f 100644--- a/crates/project/src/git_store.rs+++ b/crates/project/src/git_store.rs@@ -2349,7 +2349,7 @@ impl GitStore {return None;};- let mut paths = vec![];+ let mut paths = Vec::new();// All paths prefixed by a given repo will constitute a continuous range.while let Some(path) = entries.get(ix)&& let Some(repo_path) =@@ -2358,7 +2358,11 @@ impl GitStore {paths.push((repo_path, ix));ix += 1;}- Some((repo, paths))+ if paths.is_empty() {+ None+ } else {+ Some((repo, paths))+ }});tasks.push_back(task);}@@ -4338,7 +4342,8 @@ impl Repository {bail!("not a local repository")};let (snapshot, events) = this- .read_with(&mut cx, |this, _| {+ .update(&mut cx, |this, _| {+ this.paths_needing_status_update.clear();compute_snapshot(this.id,this.work_directory_abs_path.clone(),@@ -4568,6 +4573,9 @@ impl Repository {};let paths = changed_paths.iter().cloned().collect::<Vec<_>>();+ if paths.is_empty() {+ return Ok(());+ }let statuses = backend.status(&paths).await?;let changed_path_statuses = cx