From 986a2851bf31b770e3c432bb9136b7965a49da83 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 15 Mar 2017 19:40:58 +0000 Subject: [PATCH] onedrive: make sure we create root for server side copy --- onedrive/onedrive.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onedrive/onedrive.go b/onedrive/onedrive.go index c82bcc3f0..1d91adf33 100644 --- a/onedrive/onedrive.go +++ b/onedrive/onedrive.go @@ -615,6 +615,12 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) { return nil, errors.Errorf("can't copy %q -> %q as are same name when lowercase", srcPath, dstPath) } + // create the destination directory if necessary + err = f.dirCache.FindRoot(true) + if err != nil { + return nil, err + } + // Create temporary object dstObj, leaf, directoryID, err := f.createObject(remote, srcObj.modTime, srcObj.size) if err != nil {