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 srcFiles map[string]Object
var srcObjects = make(ObjectsChan, Config.Transfers) var srcObjects = make(ObjectsChan, Config.Transfers)
// Read dst files including excluded files if DeleteExcluded is set
go func() { go func() {
dstFiles = readFilesMap(fdst, Config.Filter.DeleteExcluded) dstFiles = readFilesMap(fdst, Config.Filter.DeleteExcluded)
listWg.Done() listWg.Done()
}() }()
// Read src file not including excluded files
go func() { go func() {
srcFiles = readFilesMap(fsrc, false) srcFiles = readFilesMap(fsrc, false)
listWg.Done() listWg.Done()
@ -543,9 +545,6 @@ func syncCopyMove(fdst, fsrc Fs, Delete bool, DoMove bool) error {
go func() { go func() {
for src := range srcObjects { for src := range srcObjects {
if !Config.Filter.IncludeObject(src) {
Debug(src, "Excluding from sync")
} else {
remote := src.Remote() remote := src.Remote()
if dst, dstFound := dstFiles[remote]; dstFound { if dst, dstFound := dstFiles[remote]; dstFound {
toBeChecked <- ObjectPair{src, dst} toBeChecked <- ObjectPair{src, dst}
@ -554,7 +553,6 @@ func syncCopyMove(fdst, fsrc Fs, Delete bool, DoMove bool) error {
toBeUploaded <- ObjectPair{src, nil} toBeUploaded <- ObjectPair{src, nil}
} }
} }
}
close(toBeChecked) close(toBeChecked)
}() }()