💄
This commit is contained in:
parent
506ce8e032
commit
ea9c5b0686
2 changed files with 4 additions and 4 deletions
|
@ -2428,7 +2428,7 @@ mod tests {
|
||||||
.as_remote_mut()
|
.as_remote_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.snapshot
|
.snapshot
|
||||||
.apply_update(update_message)
|
.apply_remote_update(update_message)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
|
@ -265,7 +265,7 @@ impl Worktree {
|
||||||
.spawn(async move {
|
.spawn(async move {
|
||||||
while let Some(update) = updates_rx.recv().await {
|
while let Some(update) = updates_rx.recv().await {
|
||||||
let mut snapshot = snapshot_tx.borrow().clone();
|
let mut snapshot = snapshot_tx.borrow().clone();
|
||||||
if let Err(error) = snapshot.apply_update(update) {
|
if let Err(error) = snapshot.apply_remote_update(update) {
|
||||||
log::error!("error applying worktree update: {}", error);
|
log::error!("error applying worktree update: {}", error);
|
||||||
}
|
}
|
||||||
*snapshot_tx.borrow_mut() = snapshot;
|
*snapshot_tx.borrow_mut() = snapshot;
|
||||||
|
@ -1000,7 +1000,7 @@ impl Snapshot {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn apply_update(&mut self, update: proto::UpdateWorktree) -> Result<()> {
|
pub(crate) fn apply_remote_update(&mut self, update: proto::UpdateWorktree) -> Result<()> {
|
||||||
let mut entries_by_path_edits = Vec::new();
|
let mut entries_by_path_edits = Vec::new();
|
||||||
let mut entries_by_id_edits = Vec::new();
|
let mut entries_by_id_edits = Vec::new();
|
||||||
for entry_id in update.removed_entries {
|
for entry_id in update.removed_entries {
|
||||||
|
@ -2618,7 +2618,7 @@ mod tests {
|
||||||
let update = scanner
|
let update = scanner
|
||||||
.snapshot()
|
.snapshot()
|
||||||
.build_update(&prev_snapshot, 0, 0, include_ignored);
|
.build_update(&prev_snapshot, 0, 0, include_ignored);
|
||||||
prev_snapshot.apply_update(update).unwrap();
|
prev_snapshot.apply_remote_update(update).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
prev_snapshot.to_vec(true),
|
prev_snapshot.to_vec(true),
|
||||||
scanner.snapshot().to_vec(include_ignored)
|
scanner.snapshot().to_vec(include_ignored)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue