Fix some syncing issues with git statuses (#25535)

Like the real app, this one infinite loops if you have a diff in an
UnsharedFile.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Conrad Irwin 2025-02-25 22:09:02 -07:00 committed by GitHub
parent 88baf171c3
commit 08539b32d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 283 additions and 6 deletions

View file

@ -49,3 +49,4 @@ windows.workspace = true
[features]
default = []
test-support = ["multi_buffer/test-support"]

View file

@ -33,7 +33,7 @@ use crate::git_panel::{GitPanel, GitPanelAddon, GitStatusEntry};
actions!(git, [Diff]);
pub(crate) struct ProjectDiff {
pub struct ProjectDiff {
multibuffer: Entity<MultiBuffer>,
editor: Entity<Editor>,
project: Entity<Project>,
@ -438,6 +438,15 @@ impl ProjectDiff {
Ok(())
}
#[cfg(any(test, feature = "test-support"))]
pub fn excerpt_paths(&self, cx: &App) -> Vec<String> {
self.multibuffer
.read(cx)
.excerpt_paths()
.map(|key| key.path().to_string_lossy().to_string())
.collect()
}
}
impl EventEmitter<EditorEvent> for ProjectDiff {}