1
mirror of https://github.com/rclone/rclone synced 2024-11-17 17:30:37 +01:00

Remove duplicate check for filter IncludeObject

This commit is contained in:
Nick Craig-Wood 2016-01-23 18:26:01 +00:00
parent 14069fd8e6
commit 12b51c5eb8

View File

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