operations: check transfer hashes when using --size-only mode #3419

Before this change we didn't calculate or check hashes of transferred
files if --size-only mode was explicitly set.

This problem was introduced in 20da3e6352 which was released with v1.37

After this change hashes are checked for all transfers unless
--ignore-checksums is set.
This commit is contained in:
Nick Craig-Wood 2019-08-12 20:54:49 +01:00
parent f9ceade9b4
commit 7c146e2618

View File

@ -282,7 +282,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
// work out which hash to use - limit to 1 hash in common
var common hash.Set
hashType := hash.None
if !fs.Config.SizeOnly && !fs.Config.IgnoreChecksum {
if !fs.Config.IgnoreChecksum {
common = src.Fs().Hashes().Overlap(f.Hashes())
if common.Count() > 0 {
hashType = common.GetOne()