diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index 3dbb266e8..11ebbb6ac 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -242,7 +242,7 @@ func printPruneStats(printer progress.Printer, stats repository.PruneStats) erro printer.V("unreferenced: %s\n", ui.FormatBytes(stats.Size.Unref)) } printer.V("total: %10d blobs / %s\n", stats.Blobs.Total, ui.FormatBytes(stats.Size.Total)) - printer.V("unused size: %s of total size\n", ui.FormatPercent(stats.Size.Unused, stats.Size.Total)) + printer.V("unused size: %s of total size\n", ui.FormatPercent(stats.Size.Duplicate+stats.Size.Unused, stats.Size.Total)) printer.P("\nto repack: %10d blobs / %s\n", stats.Blobs.Repack, ui.FormatBytes(stats.Size.Repack)) printer.P("this removes: %10d blobs / %s\n", stats.Blobs.Repackrm, ui.FormatBytes(stats.Size.Repackrm)) diff --git a/internal/repository/prune.go b/internal/repository/prune.go index 8c9f22719..9ca188f73 100644 --- a/internal/repository/prune.go +++ b/internal/repository/prune.go @@ -156,10 +156,9 @@ func PlanPrune(ctx context.Context, opts PruneOptions, repo *Repository, getUsed stats.Blobs.RemoveTotal = stats.Blobs.Remove + stats.Blobs.Repackrm stats.Blobs.Remain = stats.Blobs.Total - stats.Blobs.RemoveTotal stats.Size.Total = stats.Size.Used + stats.Size.Duplicate + stats.Size.Unused + stats.Size.Unref - stats.Size.Unused = stats.Size.Duplicate + stats.Size.Unused stats.Size.RemoveTotal = stats.Size.Remove + stats.Size.Repackrm + stats.Size.Unref stats.Size.Remain = stats.Size.Total - stats.Size.RemoveTotal - stats.Size.RemainUnused = stats.Size.Unused - stats.Size.Remove - stats.Size.Repackrm + stats.Size.RemainUnused = stats.Size.Duplicate + stats.Size.Unused - stats.Size.Remove - stats.Size.Repackrm stats.Packs.Total = stats.Packs.Used + stats.Packs.PartlyUsed + stats.Packs.Unused + stats.Packs.Unref stats.Packs.RemoveTotal = stats.Packs.Unref + stats.Packs.Remove