mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
backend: skip hash calculation when the hashType is None - fixes #8518
When hashType is None `local` backend still runs expensive logic that reads the entire file content to produce an empty string.
This commit is contained in:
committed by
Nick Craig-Wood
parent
0ee7cd80f2
commit
badf16cc34
@@ -1090,6 +1090,10 @@ func (o *Object) Remote() string {
|
||||
|
||||
// Hash returns the requested hash of a file as a lowercase hex string
|
||||
func (o *Object) Hash(ctx context.Context, r hash.Type) (string, error) {
|
||||
if r == hash.None {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Check that the underlying file hasn't changed
|
||||
o.fs.objectMetaMu.RLock()
|
||||
oldtime := o.modTime
|
||||
|
||||
Reference in New Issue
Block a user