mirror of
https://github.com/rclone/rclone.git
synced 2025-08-09 13:55:15 +02:00
Stop single file and --files-from
operations iterating through the source bucket.
This works by making sure directory listings that use a filter only iterate the files provided in the filter (if any). Single file copies now don't iterate the source or destination buckets. Note that this could potentially slow down very long `--files-from` lists - this is easy to fix (with another flag probably) if it causes anyone a problem. Fixes #610 Fixes #769
This commit is contained in:
@ -180,11 +180,11 @@ func TestNewFilterIncludeFiles(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
err = f.AddFile("/file2.jpg")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, filesMap{
|
||||
assert.Equal(t, FilesMap{
|
||||
"file1.jpg": {},
|
||||
"file2.jpg": {},
|
||||
}, f.files)
|
||||
assert.Equal(t, filesMap{}, f.dirs)
|
||||
assert.Equal(t, FilesMap{}, f.dirs)
|
||||
testInclude(t, f, []includeTest{
|
||||
{"file1.jpg", 0, 0, true},
|
||||
{"file2.jpg", 1, 0, true},
|
||||
@ -206,7 +206,7 @@ func TestNewFilterIncludeFilesDirs(t *testing.T) {
|
||||
err = f.AddFile(path)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, filesMap{
|
||||
assert.Equal(t, FilesMap{
|
||||
"path": {},
|
||||
"path/to": {},
|
||||
"path/to/dir": {},
|
||||
|
Reference in New Issue
Block a user