1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Change objecttree to set mode Rebuild if we update the snapshot after current heads

This commit is contained in:
mcrakhman 2023-01-14 20:59:54 +01:00 committed by Mikhail Iudin
parent 11d50d087a
commit 7a57d7b0c4
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
2 changed files with 14 additions and 2 deletions

View file

@ -270,7 +270,8 @@ func TestObjectTree(t *testing.T) {
assert.Equal(t, []string{"0"}, res.OldHeads)
assert.Equal(t, []string{"4"}, res.Heads)
assert.Equal(t, len(rawChanges), len(res.Added))
assert.Equal(t, Append, res.Mode)
// here we have rebuild, because we reduced tree to new snapshot
assert.Equal(t, Rebuild, res.Mode)
// check tree heads
assert.Equal(t, []string{"4"}, objTree.Heads())