From b279df2e67935912013e9ebb9c5ea11388ca18f6 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 28 Feb 2016 09:35:28 +0000 Subject: [PATCH] Drive: disable copy and move for google docs - fixes #332 --- drive/drive.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drive/drive.go b/drive/drive.go index 034edd9de..eb65d24a4 100644 --- a/drive/drive.go +++ b/drive/drive.go @@ -695,6 +695,9 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) { fs.Debug(src, "Can't copy - not same remote type") return nil, fs.ErrorCantCopy } + if srcObj.isDocument { + return nil, fmt.Errorf("Can't copy a Google document") + } o, createInfo, err := f.createFileInfo(remote, srcObj.ModTime(), srcObj.bytes) if err != nil { @@ -757,6 +760,9 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) { fs.Debug(src, "Can't move - not same remote type") return nil, fs.ErrorCantMove } + if srcObj.isDocument { + return nil, fmt.Errorf("Can't move a Google document") + } // Temporary FsObject under construction dstObj, dstInfo, err := f.createFileInfo(remote, srcObj.ModTime(), srcObj.bytes)