check: fix --one-way recursing more directories than it needs to

Before this change rclone traversed all directories in the destination.

After this change rclone doesn't traverse directories in the
destination that don't exist in the source if the `--one-way` flag is
set.

See: https://forum.rclone.org/t/check-with-one-way-flag-should-not-traverses-all-destination-directories/13263
This commit is contained in:
Nick Craig-Wood 2019-12-07 13:26:55 +00:00
parent 4537d9b5cf
commit 50bb9b7bdd
1 changed files with 3 additions and 0 deletions

View File

@ -721,6 +721,9 @@ func (c *checkMarch) DstOnly(dst fs.DirEntry) (recurse bool) {
atomic.AddInt32(&c.srcFilesMissing, 1)
case fs.Directory:
// Do the same thing to the entire contents of the directory
if c.oneway {
return false
}
return true
default:
panic("Bad object in DirEntries")