mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 00:13:49 +01:00
operations: fix server side copies on partial upload backends after refactor
After the copy refactor:
179f978f75
operations: refactor Copy into methods on an temporary object
There was some confusion in the code about server side copies - should
they or shouldn't they use partials?
This manifested in unit test failures for remotes which supported
server side Copy and PartialUploads. This combination is rare and only
exists in the sftp backend with the --sftp-copy-is-hardlink flag.
This fix makes the choice that backends which set PartialUploads
always use partials even for server side copies.
This commit is contained in:
parent
af8ba18580
commit
23ab6fa3a0
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user