Maintain remote worktrees correctly when building updates
This accidentally regressed in 53327e2.
This commit is contained in:
@@ -534,7 +534,12 @@ impl Store {
|
||||
for entry in updated_entries {
|
||||
worktree.entries.insert(entry.id, entry.clone());
|
||||
}
|
||||
Ok(project.connection_ids())
|
||||
let connection_ids = project.connection_ids();
|
||||
|
||||
#[cfg(test)]
|
||||
self.check_invariants();
|
||||
|
||||
Ok(connection_ids)
|
||||
}
|
||||
|
||||
pub fn project_connection_ids(
|
||||
@@ -619,6 +624,23 @@ impl Store {
|
||||
.guests
|
||||
.contains_key(connection_id));
|
||||
}
|
||||
|
||||
if let Some(share) = project.share.as_ref() {
|
||||
for (worktree_id, worktree) in share.worktrees.iter() {
|
||||
let mut paths = HashMap::default();
|
||||
for entry in worktree.entries.values() {
|
||||
let prev_entry = paths.insert(&entry.path, entry);
|
||||
assert_eq!(
|
||||
prev_entry,
|
||||
None,
|
||||
"worktree {:?}, duplicate path for entries {:?} and {:?}",
|
||||
worktree_id,
|
||||
prev_entry.unwrap(),
|
||||
entry
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for channel_id in &connection.channels {
|
||||
let channel = self.channels.get(channel_id).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user