1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Nick Craig-Wood
b15fd92e26 vfs: make overwriting directories give an error message - FIXME needs tests
Fixes #8253
2024-12-18 17:26:52 +00:00
Nick Craig-Wood
3fabae87fe Revert "operations: fix error reporting which was causing mount to overwrite directories."
This reverts commit 2d0007d1a5.
2024-12-18 17:25:15 +00:00
Nick Craig-Wood
2d0007d1a5 operations: fix error reporting which was causing mount to overwrite directories.
Before this change, in rclone mount, rclone was not erroring if one
directory was moved over another, instead the contents were combined.

This was caused by this commit

431524445e combine: fix operations.DirMove across upstreams - fixes #7661

The fix is to sharpen the conditions that the fallback code runs.

Fixes #8253
2024-12-18 17:01:41 +00:00

View File

@@ -1145,6 +1145,13 @@ func (d *Dir) Rename(oldName, newName string, destDir *Dir) error {
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
// Check to see if we are overwriting something with a directory
_, err := d.vfs.Stat(newPath)
if err == nil {
return EEXIST
} else if err != ENOENT {
return err
}
srcRemote := x.Remote()
dstRemote := newPath
err = operations.DirMove(context.TODO(), d.f, srcRemote, dstRemote)