diff --git a/changelog/new.txt b/changelog/new.txt index 120fcb3..1285226 100644 --- a/changelog/new.txt +++ b/changelog/new.txt @@ -5,6 +5,7 @@ Breaking changes: Bugs fixed: - backup crashed when there was a non-unicode link target. The crash has been fixed. However, non-unicode link targets are still unsupported. - Extended attributes which were saved with value null couldn't be handled. This has been fixed. +- prune: --max-repack didn't work with a given percentage of repo size. This has been fixed. New features: - copy: Added --init option to initialize uninitialized target repos diff --git a/src/commands/prune.rs b/src/commands/prune.rs index faa1334..f834dbe 100644 --- a/src/commands/prune.rs +++ b/src/commands/prune.rs @@ -574,7 +574,7 @@ impl Pruner { let max_repack = match max_repack { LimitOption::Unlimited => u64::MAX, LimitOption::Size(size) => size.as_u64(), - LimitOption::Percentage(p) => p * self.stats.size.sum().total(), + LimitOption::Percentage(p) => (p * self.stats.size.sum().total()) / 100, }; self.repack_candidates.sort_unstable_by_key(|rc| rc.0);