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

When we resolve the shortcut we now propagate the trashed status of
the shortcut into the resolved item which fixes the issue.
This commit is contained in:
Nick Craig-Wood 2020-06-11 19:23:50 +01:00
parent 84d5df3c84
commit 848c5b78e1

View File

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