From 7c146e2618d5cd080247b70b78688e47256efd3b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 12 Aug 2019 20:54:49 +0100 Subject: [PATCH] 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. --- fs/operations/operations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index fd0293d91..f67ef087d 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -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()