From bc0f4873695ee5f961e071ea37d08ce04d9fc4dd Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 7 May 2020 16:48:48 +0100 Subject: [PATCH] drive: look for dirs as well as files on NewObject This means that we can return ErrorNotAFile when there is an object with the same name as a directory rather than potentially creating a duplicate name. --- backend/drive/drive.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 1dfe24f2b..01e80ca4a 100755 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -2927,7 +2927,7 @@ func (f *Fs) getRemoteInfoWithExport(ctx context.Context, remote string) ( } directoryID = actualID(directoryID) - found, err := f.list(ctx, []string{directoryID}, leaf, false, true, false, func(item *drive.File) bool { + found, err := f.list(ctx, []string{directoryID}, leaf, false, false, false, func(item *drive.File) bool { if !f.opt.SkipGdocs { extension, exportName, exportMimeType, isDocument = f.findExportFormat(item) if exportName == leaf {