prune: correctly account for duplicates in max-unused check

The size comparison for `--max-unused` only accounted for unused but not
for duplicate data. For repositories with a large amount of duplicates
this can result in a situation where no data gets pruned even though
the amount of unused data is much higher than specified.
This commit is contained in:
Michael Eischer
2025-01-18 22:15:35 +01:00
parent ed3922ac82
commit 9331461a13
3 changed files with 91 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
Bugfix: Correctly account for duplicate data in `prune --max-unused`
`prune --max-unused size` did not correctly account for duplicate data.
If a repository contained a large amount of duplicate data, this could
previously result in pruning too little data.
This issue is now resolved.
https://github.com/restic/restic/pull/5212
https://forum.restic.net/t/restic-not-obeying-max-unused-parameter-on-prune/8879