Skip to content

Commit

Permalink
op_heads: ensure that update_op_heads([id], id) fails
Browse files Browse the repository at this point in the history
The doc states it's invalid, but I made such bug.
  • Loading branch information
yuja committed Jan 2, 2024
1 parent 6edaa97 commit 25d5f61
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/simple_op_heads_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl OpHeadsStore for SimpleOpHeadsStore {
}

fn update_op_heads(&self, old_ids: &[OperationId], new_id: &OperationId) {
assert!(!old_ids.contains(new_id));
self.add_op_head(new_id);
for old_id in old_ids {
self.remove_op_head(old_id)
Expand Down

0 comments on commit 25d5f61

Please sign in to comment.