1
mirror of https://github.com/rclone/rclone synced 2025-04-03 21:05:31 +02:00

b2: Don't re-read the SHA1 if we already have it

This commit is contained in:
Nick Craig-Wood 2016-01-19 08:20:23 +00:00
parent d9458fb4ee
commit ae3a0ec27e

@ -614,12 +614,13 @@ func (o *Object) Hash(t fs.HashType) (string, error) {
if t != fs.HashSHA1 {
return "", fs.ErrHashUnsupported
}
if o.sha1 == "" {
// Error is logged in readFileMetadata
err := o.readFileMetadata()
if err != nil {
return "", err
}
}
return o.sha1, nil
}