mirror of
https://github.com/restic/restic.git
synced 2024-12-25 09:18:55 +00:00
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:
parent
7b8e42a763
commit
734ae7fcb8
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue