mirror of
https://github.com/rclone/rclone.git
synced 2025-06-25 22:41:25 +02:00
moveto/copyto: Fix to allow copying to the same name - fixes #1736
This commit is contained in:
parent
b531bf1349
commit
fc8b13c993
@ -1716,7 +1716,9 @@ func Rmdirs(f Fs, dir string) error {
|
|||||||
|
|
||||||
// moveOrCopyFile moves or copies a single file possibly to a new name
|
// moveOrCopyFile moves or copies a single file possibly to a new name
|
||||||
func moveOrCopyFile(fdst Fs, fsrc Fs, dstFileName string, srcFileName string, cp bool) (err error) {
|
func moveOrCopyFile(fdst Fs, fsrc Fs, dstFileName string, srcFileName string, cp bool) (err error) {
|
||||||
if fdst.Name() == fsrc.Name() && dstFileName == srcFileName {
|
dstFilePath := path.Join(fdst.Root(), dstFileName)
|
||||||
|
srcFilePath := path.Join(fsrc.Root(), srcFileName)
|
||||||
|
if fdst.Name() == fsrc.Name() && dstFilePath == srcFilePath {
|
||||||
Debugf(fdst, "don't need to copy/move %s, it is already at target location", dstFileName)
|
Debugf(fdst, "don't need to copy/move %s, it is already at target location", dstFileName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user