mirror of
https://github.com/restic/restic.git
synced 2025-08-12 11:37:40 +00:00
Check number of bytes saved for each file
This commit is contained in:
@@ -241,10 +241,17 @@ func (arch *Archiver) SaveFile(node *Node) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var bytes uint64
|
||||||
|
|
||||||
node.Content = make([]backend.ID, len(blobs))
|
node.Content = make([]backend.ID, len(blobs))
|
||||||
for i, blob := range blobs {
|
for i, blob := range blobs {
|
||||||
node.Content[i] = blob.ID
|
node.Content[i] = blob.ID
|
||||||
arch.bl.Insert(blob)
|
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
|
return nil
|
||||||
|
Reference in New Issue
Block a user