mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 05:43:15 +00: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
@@ -798,6 +798,11 @@ func TestMoveFile(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
fstest.CheckItems(t, r.flocal)
|
||||
fstest.CheckItems(t, r.fremote, file2)
|
||||
|
||||
err = fs.MoveFile(r.fremote, r.flocal, file2.Path, file2.Path)
|
||||
require.NoError(t, err)
|
||||
fstest.CheckItems(t, r.flocal)
|
||||
fstest.CheckItems(t, r.fremote, file2)
|
||||
}
|
||||
|
||||
func TestCopyFile(t *testing.T) {
|
||||
@@ -819,6 +824,11 @@ func TestCopyFile(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
fstest.CheckItems(t, r.flocal, file1)
|
||||
fstest.CheckItems(t, r.fremote, file2)
|
||||
|
||||
err = fs.CopyFile(r.fremote, r.flocal, file2.Path, file2.Path)
|
||||
require.NoError(t, err)
|
||||
fstest.CheckItems(t, r.flocal, file1)
|
||||
fstest.CheckItems(t, r.fremote, file2)
|
||||
}
|
||||
|
||||
// testFsInfo is for unit testing fs.Info
|
||||
|
||||
Reference in New Issue
Block a user