mirror of
https://github.com/rclone/rclone.git
synced 2025-08-09 21:57:59 +02:00
make moveto/copyto no-ops when source and destination are the same (fixes #1261)
This commit is contained in:
committed by
Nick Craig-Wood
parent
71028e0f06
commit
decd960867
@ -1502,6 +1502,11 @@ func Rmdirs(f Fs, dir string) error {
|
||||
|
||||
// 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) {
|
||||
if fdst.Name() == fsrc.Name() && dstFileName == srcFileName {
|
||||
Debugf(fdst, "don't need to copy/move %s, it is already at target location", dstFileName)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Choose operations
|
||||
Op := Move
|
||||
if cp {
|
||||
|
Reference in New Issue
Block a user