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 move when dst is nil and fdst is case-insensitive

nielash5323a2189852
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index 7e97f2acb..8a7eb339b 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -446,6 +446,7 @@ func move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
if doMove := fdst.Features().Move; doMove != nil && (SameConfig(src.Fs(), fdst) || (SameRemoteType(src.Fs(), fdst) && (fdst.Features().ServerSideAcrossConfigs || ci.ServerSideAcrossConfigs))) {
// Delete destination if it exists and is not the same file as src (could be same file while seemingly different if the remote is case insensitive)
if dst != nil {
+ remote = dst.Remote()
if !SameObject(src, dst) {
err = DeleteFile(ctx, dst)
if err != nil {
@@ -456,6 +457,10 @@ func move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
return MoveCaseInsensitive(ctx, fdst, fdst, remote, src.Remote(), false, src)
}
}
+ } else if needsMoveCaseInsensitive(fdst, fdst, remote, src.Remote(), false) {
+ doMove = func(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
+ return MoveCaseInsensitive(ctx, fdst, fdst, remote, src.Remote(), false, src)
+ }
}
// Move dst <- src
in := tr.Account(ctx, nil) // account the transfer