sync: overlap check is now filter-sensitive

Previously, the overlap check was based on simple prefix checks of the source and destination paths. Now it actually checks whether the destination is excluded via any filter rule or a "--exclude-if-present"-file.
This commit is contained in:
Nick authored and GitHub committed 2022-06-01 18:24:54 +01:00
1 parent 2781f8e2f1
commit 3ccf222acb
4 files changed
+184 -1

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ func (strategy trackRenamesStrategy) leaf() bool {
}
func newSyncCopyMove(ctx context.Context, fdst, fsrc fs.Fs, deleteMode fs.DeleteMode, DoMove bool, deleteEmptySrcDirs bool, copyEmptySrcDirs bool) (*syncCopyMove, error) {
if (deleteMode != fs.DeleteModeOff || DoMove) && operations.Overlapping(fdst, fsrc) {
if (deleteMode != fs.DeleteModeOff || DoMove) && operations.OverlappingFilterCheck(ctx, fdst, fsrc) {
return nil, fserrors.FatalError(fs.ErrorOverlapping)
}
ci := fs.GetConfig(ctx)