forked from TrueCloudLab/restic
Check number of bytes saved for each file
This commit is contained in:
parent
a9077725ab
commit
3336f2b8e7
1 changed files with 7 additions and 0 deletions
|
@ -241,10 +241,17 @@ func (arch *Archiver) SaveFile(node *Node) error {
|
|||
}
|
||||
}
|
||||
|
||||
var bytes uint64
|
||||
|
||||
node.Content = make([]backend.ID, len(blobs))
|
||||
for i, blob := range blobs {
|
||||
node.Content[i] = blob.ID
|
||||
arch.bl.Insert(blob)
|
||||
bytes += blob.Size
|
||||
}
|
||||
|
||||
if bytes != node.Size {
|
||||
return fmt.Errorf("errors saving node %q: saved %d bytes, wanted %d bytes", node.path, bytes, node.Size)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue