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: fix spurious "--checksum is in use but the source and destination have no hashes in common"

Nick Craig-Wood20b00db39099
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index c762b3146..56e75d47c 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -181,9 +181,12 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt)
return false
}
if ht == hash.None {
- checksumWarning.Do(func() {
- fs.Logf(dst.Fs(), "--checksum is in use but the source and destination have no hashes in common; falling back to --size-only")
- })
+ common := src.Fs().Hashes().Overlap(dst.Fs().Hashes())
+ if common.Count() == 0 {
+ checksumWarning.Do(func() {
+ fs.Logf(dst.Fs(), "--checksum is in use but the source and destination have no hashes in common; falling back to --size-only")
+ })
+ }
fs.Debugf(src, "Size of src and dst objects identical")
} else {
fs.Debugf(src, "Size and %v of src and dst objects identical", ht)