(ctx context.Context, repo *Repository, removePacks restic.IDSet, oldIndexes restic.IDSet, extraObsolete restic.IDs, printer progress.Printer)
| 104 | } |
| 105 | |
| 106 | func rewriteIndexFiles(ctx context.Context, repo *Repository, removePacks restic.IDSet, oldIndexes restic.IDSet, extraObsolete restic.IDs, printer progress.Printer) error { |
| 107 | printer.P("rebuilding index\n") |
| 108 | |
| 109 | bar := printer.NewCounter("indexes processed") |
| 110 | return repo.idx.Rewrite(ctx, &internalRepository{repo}, removePacks, oldIndexes, extraObsolete, index.MasterIndexRewriteOpts{ |
| 111 | SaveProgress: bar, |
| 112 | DeleteProgress: func() *progress.Counter { |
| 113 | return printer.NewCounter("old indexes deleted") |
| 114 | }, |
| 115 | DeleteReport: func(id restic.ID, err error) { |
| 116 | if err != nil { |
| 117 | printer.VV("failed to remove index %v: %v\n", id.String(), err) |
| 118 | } else { |
| 119 | printer.VV("removed index %v\n", id.String()) |
| 120 | } |
| 121 | }, |
| 122 | }) |
| 123 | } |
no test coverage detected