2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

Merge pull request #2677 from MichaelEischer/complain-about-invalid-indexes

rebuild_index: Report invalid packs that were ignored
This commit is contained in:
MichaelEischer 2020-04-18 16:57:50 +02:00 committed by GitHub
commit 08ec6c9f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,11 +62,17 @@ func rebuildIndex(ctx context.Context, repo restic.Repository, ignorePacks resti
} }
bar := newProgressMax(!globalOptions.Quiet, packs-uint64(len(ignorePacks)), "packs") bar := newProgressMax(!globalOptions.Quiet, packs-uint64(len(ignorePacks)), "packs")
idx, _, err := index.New(ctx, repo, ignorePacks, bar) idx, invalidFiles, err := index.New(ctx, repo, ignorePacks, bar)
if err != nil { if err != nil {
return err return err
} }
if globalOptions.verbosity >= 2 {
for _, id := range invalidFiles {
Printf("skipped incomplete pack file: %v\n", id)
}
}
Verbosef("finding old index files\n") Verbosef("finding old index files\n")
var supersedes restic.IDs var supersedes restic.IDs