aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/lfs_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Remove GetByBean method because sometimes it's danger when query condition ↵Lunny Xiao2023-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | parameter is zero and also introduce new generic methods (#28220) The function `GetByBean` has an obvious defect that when the fields are empty values, it will be ignored. Then users will get a wrong result which is possibly used to make a security problem. To avoid the possibility, this PR removed function `GetByBean` and all references. And some new generic functions have been introduced to be used. The recommand usage like below. ```go // if query an object according id obj, err := db.GetByID[Object](ctx, id) // query with other conditions obj, err := db.Get[Object](ctx, builder.Eq{"a": a, "b":b}) ```
* Delete repos of org when purge delete user (#27273)JakobDev2023-10-191-3/+4
| | | | | | | Fixes https://codeberg.org/forgejo/forgejo/issues/1514 I had to remove `RenameOrganization` to avoid circular import. We should really add some foreign keys to the database.
* Fix bugs in LFS meta garbage collection (#26122)Zettat1232023-07-261-0/+64
This PR - Fix #26093. Replace `time.Time` with `timeutil.TimeStamp` - Fix #26135. Add missing `xorm:"extends"` to `CountLFSMetaObject` for LFS meta object query - Add a unit test for LFS meta object garbage collection