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:
Nick Craig-Wood
2019-02-13 17:14:51 +00:00
parent b05da61c82
commit a28239f005
4 changed files with 32 additions and 10 deletions

View File

@ -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) {