forked from TrueCloudLab/restic
Merge pull request #2487 from rawtaz/2469-fix-diff-stats
diff: Fix wrong bytes reported in diff stats (#2469)
This commit is contained in:
commit
02108f202e
2 changed files with 7 additions and 2 deletions
5
changelog/unreleased/issue-2469
Normal file
5
changelog/unreleased/issue-2469
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Bugfix: Fix incorrect bytes stats in `diff` command
|
||||||
|
|
||||||
|
In some cases, the wrong number of bytes (e.g. 16777215.998 TiB) were reported by the `diff` command. This is now fixed.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/issues/2469
|
|
@ -66,7 +66,7 @@ type Comparer struct {
|
||||||
type DiffStat struct {
|
type DiffStat struct {
|
||||||
Files, Dirs, Others int
|
Files, Dirs, Others int
|
||||||
DataBlobs, TreeBlobs int
|
DataBlobs, TreeBlobs int
|
||||||
Bytes int
|
Bytes uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add adds stats information for node to s.
|
// Add adds stats information for node to s.
|
||||||
|
@ -141,7 +141,7 @@ func updateBlobs(repo restic.Repository, blobs restic.BlobSet, stats *DiffStat)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.Bytes += int(size)
|
stats.Bytes += uint64(size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue