From 271ec4318900b8c44651ba707e1fba966799216e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 16 Apr 2024 17:15:02 +0100 Subject: [PATCH] sync: don't need to sync directories if they haven't been modified Before this change we synced directories regardless if the source directory existed. It is irrelevant whether the source directory exists or not, what we need to know is has the directory been modified. Co-authored-by: nielash --- fs/sync/sync.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/sync/sync.go b/fs/sync/sync.go index 4a8e5d86d..054938bc8 100644 --- a/fs/sync/sync.go +++ b/fs/sync/sync.go @@ -1203,10 +1203,8 @@ func (s *syncCopyMove) setDelayedDirModTimes(ctx context.Context) error { if gCtx.Err() != nil { break } - if item.src == nil { - if _, ok := s.modifiedDirs[item.dir]; !ok { - continue - } + if _, ok := s.modifiedDirs[item.dir]; !ok { + continue } if !s.copyEmptySrcDirs { if _, isEmpty := s.srcEmptyDirs[item.dir]; isEmpty {