Restore project diff test (#21606)

Restores a basic project diff test

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-12-05 21:48:33 +02:00 committed by GitHub
parent 787c75cbda
commit 1efd165ead
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 141 additions and 112 deletions

View file

@ -49,6 +49,7 @@ struct SharedBuffer {
unstaged_changes: Option<Model<BufferChangeSet>>,
}
#[derive(Debug)]
pub struct BufferChangeSet {
pub buffer_id: BufferId,
pub base_text: Option<Model<Buffer>>,
@ -1045,6 +1046,12 @@ impl BufferStore {
.spawn(async move { task.await.map_err(|e| anyhow!("{e}")) })
}
#[cfg(any(test, feature = "test-support"))]
pub fn set_change_set(&mut self, buffer_id: BufferId, change_set: Model<BufferChangeSet>) {
self.loading_change_sets
.insert(buffer_id, Task::ready(Ok(change_set)).shared());
}
pub async fn open_unstaged_changes_internal(
this: WeakModel<Self>,
text: Result<Option<String>>,