forked from TrueCloudLab/restic
Merge pull request #1955 from restic/fix-prune-1954
prune: Fix calculation for removed bytes
This commit is contained in:
commit
89f17847ad
1 changed files with 4 additions and 4 deletions
|
@ -149,8 +149,8 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
|
||||||
len(idx.Packs), blobs, formatBytes(uint64(stats.bytes)))
|
len(idx.Packs), blobs, formatBytes(uint64(stats.bytes)))
|
||||||
|
|
||||||
blobCount := make(map[restic.BlobHandle]int)
|
blobCount := make(map[restic.BlobHandle]int)
|
||||||
duplicateBlobs := 0
|
var duplicateBlobs uint64
|
||||||
duplicateBytes := 0
|
var duplicateBytes uint64
|
||||||
|
|
||||||
// find duplicate blobs
|
// find duplicate blobs
|
||||||
for _, p := range idx.Packs {
|
for _, p := range idx.Packs {
|
||||||
|
@ -161,7 +161,7 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
|
||||||
|
|
||||||
if blobCount[h] > 1 {
|
if blobCount[h] > 1 {
|
||||||
duplicateBlobs++
|
duplicateBlobs++
|
||||||
duplicateBytes += int(entry.Length)
|
duplicateBytes += uint64(entry.Length)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
removeBytes += int(blob.Length)
|
removeBytes += uint64(blob.Length)
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasActiveBlob {
|
if hasActiveBlob {
|
||||||
|
|
Loading…
Reference in a new issue