From 530ba66d35329fa4ef16a943c6bd60c519307db9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 4 Sep 2019 11:47:26 +0100 Subject: [PATCH] operations: fix -u/--update with google photos / files of unknown size Before this change if -u/--update was in effect we compared the size of the files to see if the transfer should go ahead. This was comparing -1 with an actual size so the transfer always proceeded. After this change we use the existing `sizeDiffers` function which does the correct comparison with -1 for files of unknown length. See: https://forum.rclone.org/t/sync-with-google-photos-to-local-drive-will-result-in-recoping/11605 --- 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 65fd1d8ff..8e5a9e707 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -1527,7 +1527,7 @@ func NeedTransfer(ctx context.Context, dst, src fs.Object) bool { case dt <= -modifyWindow: fs.Debugf(src, "Destination is older than source, transferring") default: - if src.Size() == dst.Size() { + if !sizeDiffers(src, dst) { fs.Debugf(src, "Destination mod time is within %v of source and sizes identical, skipping", modifyWindow) return false }