Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Remove duplicate check for filter IncludeObject

Nick Craig-Wood12b51c5eb8c4
diff --git a/fs/operations.go b/fs/operations.go
index 89a89b27b..8e93a09aa 100644
--- a/fs/operations.go
+++ b/fs/operations.go
@@ -456,11 +456,13 @@ func syncCopyMove(fdst, fsrc Fs, Delete bool, DoMove bool) error {
var srcFiles map[string]Object
var srcObjects = make(ObjectsChan, Config.Transfers)
+ // Read dst files including excluded files if DeleteExcluded is set
go func() {
dstFiles = readFilesMap(fdst, Config.Filter.DeleteExcluded)
listWg.Done()
}()
+ // Read src file not including excluded files
go func() {
srcFiles = readFilesMap(fsrc, false)
listWg.Done()
@@ -543,16 +545,12 @@ func syncCopyMove(fdst, fsrc Fs, Delete bool, DoMove bool) error {
go func() {
for src := range srcObjects {
- if !Config.Filter.IncludeObject(src) {
- Debug(src, "Excluding from sync")
+ remote := src.Remote()
+ if dst, dstFound := dstFiles[remote]; dstFound {
+ toBeChecked <- ObjectPair{src, dst}
} else {
- remote := src.Remote()
- if dst, dstFound := dstFiles[remote]; dstFound {
- toBeChecked <- ObjectPair{src, dst}
- } else {
- // No need to check since doesn't exist
- toBeUploaded <- ObjectPair{src, nil}
- }
+ // No need to check since doesn't exist
+ toBeUploaded <- ObjectPair{src, nil}
}
}
close(toBeChecked)