This commit is contained in:
Nathan Sobo 2022-01-22 15:21:33 -07:00
parent 506ce8e032
commit ea9c5b0686
2 changed files with 4 additions and 4 deletions

View file

@ -2428,7 +2428,7 @@ mod tests {
.as_remote_mut()
.unwrap()
.snapshot
.apply_update(update_message)
.apply_remote_update(update_message)
.unwrap();
assert_eq!(

View file

@ -265,7 +265,7 @@ impl Worktree {
.spawn(async move {
while let Some(update) = updates_rx.recv().await {
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);
}
*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_id_edits = Vec::new();
for entry_id in update.removed_entries {
@ -2618,7 +2618,7 @@ mod tests {
let update = scanner
.snapshot()
.build_update(&prev_snapshot, 0, 0, include_ignored);
prev_snapshot.apply_update(update).unwrap();
prev_snapshot.apply_remote_update(update).unwrap();
assert_eq!(
prev_snapshot.to_vec(true),
scanner.snapshot().to_vec(include_ignored)