From b89874e5c92afc9ebcd6d294b06730fdf5a9e5e1 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 20 Feb 2019 16:30:30 +0100 Subject: [PATCH] Prevent incorrect move Moving from a to b where a=b will caouse system.io.exception => job fails --- .../WindowsFileSystemAdapter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SyncPro.Adapters.WindowsFileSystem/WindowsFileSystemAdapter.cs b/SyncPro.Adapters.WindowsFileSystem/WindowsFileSystemAdapter.cs index 8663d57..66e8aab 100644 --- a/SyncPro.Adapters.WindowsFileSystem/WindowsFileSystemAdapter.cs +++ b/SyncPro.Adapters.WindowsFileSystem/WindowsFileSystemAdapter.cs @@ -175,7 +175,8 @@ public override void UpdateItem(EntryUpdateInfo updateInfo, SyncEntryChangedFlag else if (updateInfo.Entry.Type == SyncEntryType.Directory) { Pre.Assert(!string.IsNullOrEmpty(newFullPath), "newFullPath != null"); - Directory.Move(fullPath, newFullPath); + if (fullPath != newFullPath) + Directory.Move(fullPath, newFullPath); } else { @@ -680,4 +681,4 @@ public void Dispose() this.fileSystemWatcher?.Dispose(); } } -} \ No newline at end of file +}