mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 12:36:38 +08:00
sync: don't sync directory modtimes from backends which don't have directories
Some backends (like s3, swift, gcs, azureblob) don't have directories (this can be overridden on some using the directory markers feature). It therefore makes no sense to sync directory times from them as they will all be a value made up by rclone (--default-time) We use the feature flag CanHaveEmptyDirectories to mark backends without real directory support and disable the directory modification time syncing on those.
This commit is contained in:
parent
f491efc85d
commit
ac830ddd42
|
@ -154,8 +154,8 @@ func newSyncCopyMove(ctx context.Context, fdst, fsrc fs.Fs, deleteMode fs.Delete
|
|||
trackRenamesCh: make(chan fs.Object, ci.Checkers),
|
||||
checkFirst: ci.CheckFirst,
|
||||
setDirMetadata: ci.Metadata && fsrc.Features().ReadDirMetadata && fdst.Features().WriteDirMetadata,
|
||||
setDirModTime: !ci.NoUpdateDirModTime && (fdst.Features().WriteDirSetModTime || fdst.Features().MkdirMetadata != nil || fdst.Features().DirSetModTime != nil),
|
||||
setDirModTimeAfter: !ci.NoUpdateDirModTime && fdst.Features().DirModTimeUpdatesOnWrite,
|
||||
setDirModTime: (!ci.NoUpdateDirModTime && fsrc.Features().CanHaveEmptyDirectories) && (fdst.Features().WriteDirSetModTime || fdst.Features().MkdirMetadata != nil || fdst.Features().DirSetModTime != nil),
|
||||
setDirModTimeAfter: !ci.NoUpdateDirModTime && fsrc.Features().CanHaveEmptyDirectories && fdst.Features().DirModTimeUpdatesOnWrite,
|
||||
modifiedDirs: make(map[string]struct{}),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user