From 90243ed1c4c67532bfce4b86177fc310b358acf4 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 8 Mar 2020 01:19:58 +0100 Subject: [PATCH] rebuild_index: Report invalid packs that were ignored --- cmd/restic/cmd_rebuild_index.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_rebuild_index.go b/cmd/restic/cmd_rebuild_index.go index 768080668..7f150150f 100644 --- a/cmd/restic/cmd_rebuild_index.go +++ b/cmd/restic/cmd_rebuild_index.go @@ -62,11 +62,17 @@ func rebuildIndex(ctx context.Context, repo restic.Repository, ignorePacks resti } 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 { return err } + if globalOptions.verbosity >= 2 { + for _, id := range invalidFiles { + Printf("skipped incomplete pack file: %v\n", id) + } + } + Verbosef("finding old index files\n") var supersedes restic.IDs