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 server side copies on partial upload backends after refactor

Nick Craig-Wood23ab6fa3a0ca
diff --git a/fs/operations/copy.go b/fs/operations/copy.go
index a2a2ebebd..596c7ed04 100644
--- a/fs/operations/copy.go
+++ b/fs/operations/copy.go
@@ -146,11 +146,8 @@ func (c *copy) serverSideCopy(ctx context.Context) (actionTaken string, newDst f
newDst, err = doCopy(ctx, c.src, c.remoteForCopy)
if err == nil {
in.ServerSideCopyEnd(newDst.Size()) // account the bytes for the server-side transfer
- _ = in.Close()
- c.inplace = true
- } else {
- _ = in.Close()
}
+ _ = in.Close()
if errors.Is(err, fs.ErrorCantCopy) {
c.tr.Reset(ctx) // skip incomplete accounting - will be overwritten by the manual copy
}