From 16da1b4994a776f9d6a30ebd9af77aaef177851f Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 22 Jan 2019 15:14:53 +0900 Subject: [PATCH] treat mv of new file as upload of mv target (Issue: #357) --- src/sync.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sync.d b/src/sync.d index e478959f..c903a8af 100644 --- a/src/sync.d +++ b/src/sync.d @@ -1826,12 +1826,15 @@ final class SyncEngine } // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_move + // This function is only called in monitor mode when an move event is coming from + // inotify and we try to move the item. void uploadMoveItem(string from, string to) { log.log("Moving ", from, " to ", to); Item fromItem, toItem, parentItem; if (!itemdb.selectByPath(from, defaultDriveId, fromItem)) { - throw new SyncException("Can't move an unsynced item"); + uploadNewFile(to); + return; } if (fromItem.parentId == null) { // the item is a remote folder, need to do the operation on the parent