mirror of
https://github.com/rclone/rclone.git
synced 2025-03-15 07:48:42 +01:00
b2: Don't re-read the SHA1 if we already have it
This commit is contained in:
parent
d9458fb4ee
commit
ae3a0ec27e
11
b2/b2.go
11
b2/b2.go
@ -614,11 +614,12 @@ func (o *Object) Hash(t fs.HashType) (string, error) {
|
||||
if t != fs.HashSHA1 {
|
||||
return "", fs.ErrHashUnsupported
|
||||
}
|
||||
|
||||
// Error is logged in readFileMetadata
|
||||
err := o.readFileMetadata()
|
||||
if err != nil {
|
||||
return "", err
|
||||
if o.sha1 == "" {
|
||||
// Error is logged in readFileMetadata
|
||||
err := o.readFileMetadata()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return o.sha1, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user