Skip to content

Commit

Permalink
sync: fix optional feature not implemented errors
Browse files Browse the repository at this point in the history
10eb474
introduced a bug that caused operations.CopyDirMetadata to sometimes be called
even when the dest Fs lacks metadata support. This resulted in errors such as
`expecting X to have MkdirMetadata method: optional feature not implemented` and
`expecting X to have SetMetadata method`. This change fixes the issue by instead
using operations.SetDirModTime when s.setDirMetadata is false.
  • Loading branch information
nielash committed May 19, 2024
1 parent 47690fb commit 1e8d42f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ func (s *syncCopyMove) setDelayedDirModTimes(ctx context.Context) error {
g.Go(func() error {
var err error
// if item.src is set must copy full metadata
if item.src != nil {
if item.src != nil && s.setDirMetadata {
_, err = operations.CopyDirMetadata(gCtx, s.fdst, item.dst, item.dir, item.src)
} else {
_, err = operations.SetDirModTime(gCtx, s.fdst, item.dst, item.dir, item.modTime)
Expand Down

0 comments on commit 1e8d42f

Please sign in to comment.