From 50bb9b7bddfd8e2dca92af935082b173a690d1f4 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 7 Dec 2019 13:26:55 +0000 Subject: [PATCH] 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 --- fs/operations/operations.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 9e269b72f..0df993486 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -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")