storage: fix missing continue in keyIndex.since
It should continue to skip following operations. The test from rev14 to rev0 fails if it doesn't call continue and append all revisions of the same main rev to the list.release-2.3
parent
158d6e0e03
commit
87b5143b15
|
@ -177,6 +177,7 @@ func (ki *keyIndex) since(rev int64) []revision {
|
||||||
// replace the revision with a new one that has higher sub value,
|
// replace the revision with a new one that has higher sub value,
|
||||||
// because the original one should not be seen by external
|
// because the original one should not be seen by external
|
||||||
revs[len(revs)-1] = r
|
revs[len(revs)-1] = r
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
revs = append(revs, r)
|
revs = append(revs, r)
|
||||||
last = r.main
|
last = r.main
|
||||||
|
|
|
@ -97,6 +97,21 @@ func TestKeyIndexSince(t *testing.T) {
|
||||||
{17, nil},
|
{17, nil},
|
||||||
{16, allRevs[6:]},
|
{16, allRevs[6:]},
|
||||||
{15, allRevs[6:]},
|
{15, allRevs[6:]},
|
||||||
|
{14, allRevs[5:]},
|
||||||
|
{13, allRevs[5:]},
|
||||||
|
{12, allRevs[4:]},
|
||||||
|
{11, allRevs[4:]},
|
||||||
|
{10, allRevs[3:]},
|
||||||
|
{9, allRevs[3:]},
|
||||||
|
{8, allRevs[2:]},
|
||||||
|
{7, allRevs[2:]},
|
||||||
|
{6, allRevs[1:]},
|
||||||
|
{5, allRevs[1:]},
|
||||||
|
{4, allRevs},
|
||||||
|
{3, allRevs},
|
||||||
|
{2, allRevs},
|
||||||
|
{1, allRevs},
|
||||||
|
{0, allRevs},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
|
|
Loading…
Reference in New Issue