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.
This commit is contained in:
Nick Craig-Wood 2020-05-07 16:48:48 +01:00
parent e103c4c26a
commit bc0f487369
1 changed files with 1 additions and 1 deletions

View File

@ -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 {