Skip to content

Commit

Permalink
Do not clean up the trash item when only a subdirectory was restored
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Aug 1, 2024
1 parent 8ae72b7 commit 1196c96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/storage/fs/posix/trashbin/trashbin.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ func (tb *Trashbin) RestoreRecycleItem(ctx context.Context, ref *provider.Refere
tb.lu.CacheID(ctx, n.SpaceID, string(id), restorePath)

// cleanup trash info
return os.Remove(filepath.Join(trashRoot, "info", key+".trashinfo"))
if relativePath == "." || relativePath == "/" {
return os.Remove(filepath.Join(trashRoot, "info", key+".trashinfo"))
} else {
return nil
}
}

// PurgeRecycleItem purges the specified item, all its children and all their revisions
Expand Down

0 comments on commit 1196c96

Please sign in to comment.