mirror of
https://github.com/restic/restic.git
synced 2024-12-25 01:06:39 +00:00
parent
b85eae2aea
commit
4ca134a41c
1 changed files with 4 additions and 2 deletions
|
@ -35,14 +35,16 @@ func Repack(repo restic.Repository, packs restic.IDSet, keepBlobs restic.BlobSet
|
|||
return err
|
||||
}
|
||||
|
||||
defer beRd.Close()
|
||||
|
||||
hrd := hashing.NewReader(beRd, sha256.New())
|
||||
packLength, err := io.Copy(tempfile, hrd)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Copy")
|
||||
}
|
||||
|
||||
if err = beRd.Close(); err != nil {
|
||||
return errors.Wrap(err, "Close")
|
||||
}
|
||||
|
||||
hash := restic.IDFromHash(hrd.Sum(nil))
|
||||
debug.Log("pack %v loaded (%d bytes), hash %v", packID.Str(), packLength, hash.Str())
|
||||
|
||||
|
|
Loading…
Reference in a new issue