From 557dd8f031d7c58202dd7634b204214ad22a0591 Mon Sep 17 00:00:00 2001 From: Iakov Davydov Date: Thu, 16 Nov 2017 15:38:25 +0100 Subject: [PATCH] ListDirSorted check for excludefile --- fs/operations.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/operations.go b/fs/operations.go index 267f7daa9..b3595c7f2 100644 --- a/fs/operations.go +++ b/fs/operations.go @@ -622,6 +622,10 @@ func ListDirSorted(fs Fs, includeAll bool, dir string) (entries DirEntries, err if err != nil { return nil, err } + if !includeAll && Config.Filter.ListContainsExcludeFile(entries) { + Debugf(dir, "Excluded from sync (and deletion) based on exclude file") + return nil, nil + } return filterAndSortDir(entries, includeAll, dir, Config.Filter.IncludeObject, Config.Filter.IncludeDirectory) }