mirror of
https://github.com/rclone/rclone.git
synced 2025-05-31 00:05:54 +08:00
filter: Make --files-from traverse as before unless --no-traverse is set
In c5ac96e9e7 we made --files-from only read the objects specified and don't scan directories. This caused problems with Google drive (very very slow) and B2 (excessive API consumption) so it was decided to make the old behaviour (traversing the directories) the default with --files-from and use the existing --no-traverse flag (which has exactly the right semantics) to enable the new non scanning behaviour. See: https://forum.rclone.org/t/using-files-from-with-drive-hammers-the-api/8726 Fixes #3102 Fixes #3095
This commit is contained in:
@ -124,6 +124,18 @@ func TestLsWithFilesFrom(t *testing.T) {
|
||||
err = operations.List(r.Fremote, &buf)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, " 60 potato2\n", buf.String())
|
||||
|
||||
// Now try with --no-traverse
|
||||
oldNoTraverse := fs.Config.NoTraverse
|
||||
fs.Config.NoTraverse = true
|
||||
defer func() {
|
||||
fs.Config.NoTraverse = oldNoTraverse
|
||||
}()
|
||||
|
||||
buf.Reset()
|
||||
err = operations.List(r.Fremote, &buf)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, " 60 potato2\n", buf.String())
|
||||
}
|
||||
|
||||
func TestLsLong(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user