mirror of
https://github.com/rclone/rclone.git
synced 2025-03-04 11:47:24 +08:00
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:
parent
84d5df3c84
commit
848c5b78e1
@ -1972,9 +1972,10 @@ func (f *Fs) resolveShortcut(item *drive.File) (newItem *drive.File, err error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to resolve shortcut")
|
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.Name = item.Name
|
||||||
newItem.Parents = item.Parents
|
newItem.Parents = item.Parents
|
||||||
|
newItem.Trashed = item.Trashed
|
||||||
// the new ID is a composite ID
|
// the new ID is a composite ID
|
||||||
newItem.Id = joinID(newItem.Id, item.Id)
|
newItem.Id = joinID(newItem.Id, item.Id)
|
||||||
return newItem, nil
|
return newItem, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user