summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAlexander Neumann <alexander@bumpern.de>2015-10-25 21:51:57 +0100
committerAlexander Neumann <alexander@bumpern.de>2015-10-25 21:51:57 +0100
commit734ae7fcb8064d5e2fe9488f2ad575262f8c89ec (patch)
treec250d5dd3aa423a9d480870fda7e93914a8f8262 /cmd
parent7b8e42a763c9ce572c2423b4851e823974f614cb (diff)
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.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/restic/integration_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/restic/integration_test.go b/cmd/restic/integration_test.go
index c2d5f7197..fa95eca92 100644
--- a/cmd/restic/integration_test.go
+++ b/cmd/restic/integration_test.go
@@ -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)
+}