mirror of
https://github.com/octoleo/restic.git
synced 2024-09-27 22:19:02 +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
@ -18,6 +18,7 @@ import (
|
|||||||
"github.com/restic/restic/backend"
|
"github.com/restic/restic/backend"
|
||||||
"github.com/restic/restic/debug"
|
"github.com/restic/restic/debug"
|
||||||
"github.com/restic/restic/filter"
|
"github.com/restic/restic/filter"
|
||||||
|
"github.com/restic/restic/repository"
|
||||||
. "github.com/restic/restic/test"
|
. "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 New Issue
Block a user