Add test for corner case

It was observed that a restic repository still contained overlapping
indexes after `rebuild-index` has been called. This is caused by
instantly forgetting that blobs have already been saved once a full
index has been written during index rebuilding.

This commit adds a (failing) test that shows the behaviour.
This commit is contained in:
Alexander Neumann 2015-10-25 21:51:57 +01:00
parent 7b8e42a763
commit 734ae7fcb8
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import (
"github.com/restic/restic/backend"
"github.com/restic/restic/debug"
"github.com/restic/restic/filter"
"github.com/restic/restic/repository"
. "github.com/restic/restic/test"
)
@ -683,3 +684,8 @@ func TestRebuildIndex(t *testing.T) {
}
})
}
func TestRebuildIndexAlwaysFull(t *testing.T) {
repository.IndexFull = func(*repository.Index) bool { return true }
TestRebuildIndex(t)
}