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

rcat: check checksums by default like copy does #6305

Nick Craig-Wood2e54b56a01b1
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index e00a20a9e..0b0f9f75e 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -1391,11 +1391,14 @@ func Rcat(ctx context.Context, fdst fs.Fs, dstFileName string, in io.ReadCloser,
compare := func(dst fs.Object) error {
var sums map[hash.Type]string
+ opt := defaultEqualOpt(ctx)
if hasher != nil {
+ // force --checksum on if we have hashes
+ opt.checkSum = true
sums = hasher.Sums()
}
src := object.NewStaticObjectInfo(dstFileName, modTime, int64(readCounter.BytesRead()), false, sums, fdst)
- if !Equal(ctx, src, dst) {
+ if !equal(ctx, src, dst, opt) {
err = fmt.Errorf("corrupted on transfer")
err = fs.CountError(err)
fs.Errorf(dst, "%v", err)