ok/jj
1
0
Fork 0
forked from mirrors/jj

op_heads: ensure that update_op_heads([id], id) fails

The doc states it's invalid, but I made such bug.
This commit is contained in:
Yuya Nishihara 2024-01-02 16:11:31 +09:00
parent 3f0a49dafe
commit 392e83be42

View file

@ -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)