Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

operations: don't calculate checksums when using --ignore-checksum #3419

Nick Craig-Woodf9ceade9b4c9
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index 28d7c0499..fd0293d91 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 {
+ if !fs.Config.SizeOnly && !fs.Config.IgnoreChecksum {
common = src.Fs().Hashes().Overlap(f.Hashes())
if common.Count() > 0 {
hashType = common.GetOne()
@@ -392,7 +392,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
}
// Verify hashes are the same after transfer - ignoring blank hashes
- if !fs.Config.IgnoreChecksum && hashType != hash.None {
+ if hashType != hash.None {
// checkHashes has logged and counted errors
equal, _, srcSum, dstSum, _ := checkHashes(ctx, src, dst, hashType)
if !equal {