Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: fix not being able to delete a directory with a trashed shortcut

Nick Craig-Wood848c5b78e10c
diff --git a/backend/drive/drive.go b/backend/drive/drive.go
index 81446cdba..ec0aa1c5f 100755
--- a/backend/drive/drive.go
+++ b/backend/drive/drive.go
@@ -1972,9 +1972,10 @@ func (f *Fs) resolveShortcut(item *drive.File) (newItem *drive.File, err error)
if err != nil {
return nil, errors.Wrap(err, "failed to resolve shortcut")
}
- // make sure we use the Name and Parents from the original item
+ // make sure we use the Name, Parents and Trashed from the original item
newItem.Name = item.Name
newItem.Parents = item.Parents
+ newItem.Trashed = item.Trashed
// the new ID is a composite ID
newItem.Id = joinID(newItem.Id, item.Id)
return newItem, nil