mirror of
https://github.com/restic/restic.git
synced 2024-12-22 15:57:07 +00:00
Correct #2537 (cmd_stats file counting issue)
This commit is contained in:
parent
8bf6a3af97
commit
23055aaadf
2 changed files with 11 additions and 1 deletions
5
changelog/unreleased/issue-2537
Normal file
5
changelog/unreleased/issue-2537
Normal file
|
@ -0,0 +1,5 @@
|
|||
Bugfix: Fix incorrect file counts in `stats --mode restore-size`
|
||||
|
||||
The restore-size mode of stats was failing to count empty directories and some files with hard links.
|
||||
|
||||
https://github.com/restic/restic/issues/2537
|
|
@ -247,8 +247,13 @@ func statsWalkTree(repo restic.Repository, stats *statsContainer) walker.WalkFun
|
|||
// as this is a file in the snapshot, we can simply count its
|
||||
// size without worrying about uniqueness, since duplicate files
|
||||
// will still be restored
|
||||
stats.TotalSize += node.Size
|
||||
stats.TotalFileCount++
|
||||
|
||||
// TODO - Issue #2531 Handle hard links by identifying duplicate inodes.
|
||||
// (Duplicates should appear in the file count, but not the size count)
|
||||
stats.TotalSize += node.Size
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return true, nil
|
||||
|
|
Loading…
Reference in a new issue