"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
Stop --track-renames deleting case folded source files - fixes #1094
Nick Craig-Woode59dc81658d7
diff --git a/fs/sync.go b/fs/sync.goindex 0e0fd596b..754badd0a 100644--- a/fs/sync.go+++ b/fs/sync.go@@ -593,17 +593,23 @@ func (s *syncCopyMove) tryRename(src Object) bool {Stats.Checking(src.Remote())defer Stats.DoneChecking(src.Remote())+ // Calculate the hash of the src objecthash := s.renameHash(src)if hash == "" {return false}+ // Get a match on fdstdst := s.popRenameMap(hash)if dst == nil {return false}- err := MoveFile(s.fdst, s.fdst, src.Remote(), dst.Remote())+ // Find dst object we are about to overwrite if it exists+ dstOverwritten, _ := s.fdst.NewObject(src.Remote())++ // Rename dst to have name src.Remote()+ err := Move(s.fdst, dstOverwritten, src.Remote(), dst)if err != nil {Debugf(src, "Failed to rename to %q: %v", dst.Remote(), err)return falsediff --git a/onedrive/onedrive.go b/onedrive/onedrive.goindex ae230763c..c40b9f9d3 100644--- a/onedrive/onedrive.go+++ b/onedrive/onedrive.go@@ -600,6 +600,10 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) {return nil, err}+ if strings.ToLower(srcObj.remote) == strings.ToLower(remote) {+ return nil, errors.Errorf("can't copy %q -> %q as are same name when lowercase", srcObj.remote, remote)+ }+// Create temporary objectdstObj, leaf, directoryID, err := f.createObject(remote, srcObj.modTime, srcObj.size)if err != nil {