(ctx context.Context, rep repo.DirectRepositoryWriter)
| 41 | } |
| 42 | |
| 43 | func (c *commandContentRewrite) runContentRewriteCommand(ctx context.Context, rep repo.DirectRepositoryWriter) error { |
| 44 | c.svc.dangerousCommand() |
| 45 | |
| 46 | contentIDs, err := toContentIDs(c.contentRewriteIDs) |
| 47 | if err != nil { |
| 48 | return err |
| 49 | } |
| 50 | |
| 51 | _, err = maintenance.RewriteContents(ctx, rep, &maintenance.RewriteContentsOptions{ |
| 52 | ContentIDRange: c.contentRange.contentIDRange(), |
| 53 | ContentIDs: contentIDs, |
| 54 | FormatVersion: c.contentRewriteFormatVersion, |
| 55 | PackPrefix: blob.ID(c.contentRewritePackPrefix), |
| 56 | Parallel: c.contentRewriteParallelism, |
| 57 | ShortPacks: c.contentRewriteShortPacks, |
| 58 | DryRun: c.contentRewriteDryRun, |
| 59 | }, c.contentRewriteSafety) |
| 60 | |
| 61 | return errors.Wrap(err, "error rewriting contents") |
| 62 | } |
| 63 | |
| 64 | func toContentIDs(s []string) ([]content.ID, error) { |
| 65 | var result []content.ID |
nothing calls this directly
no test coverage detected