dedupe: Use walk.ListR for listing commands.

This dramatically increases the speed (7x in my tests) of the de-dupe
as google drive supports ListR directly and dedupe did not work with
`--fast-list`.

Fixes #2902
This commit is contained in:
Nick Craig-Wood
2019-01-21 16:59:23 +00:00
parent e5f4210b09
commit 4376019062
2 changed files with 3 additions and 12 deletions

View File

@@ -161,10 +161,7 @@ func TestDeduplicateRename(t *testing.T) {
err := operations.Deduplicate(r.Fremote, operations.DeduplicateRename)
require.NoError(t, err)
require.NoError(t, walk.Walk(r.Fremote, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
if err != nil {
return err
}
require.NoError(t, walk.ListR(r.Fremote, "", true, -1, walk.ListObjects, func(entries fs.DirEntries) error {
entries.ForObject(func(o fs.Object) {
remote := o.Remote()
if remote != "one-1.txt" &&