mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
models/repo: avoid duplicated results in SearchRepositoryByName (#4344)
This commit is contained in:
parent
c238647020
commit
496e07c1c9
@ -1654,7 +1654,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int
|
|||||||
if len(opts.OrderBy) > 0 {
|
if len(opts.OrderBy) > 0 {
|
||||||
sess.OrderBy("repo." + opts.OrderBy)
|
sess.OrderBy("repo." + opts.OrderBy)
|
||||||
}
|
}
|
||||||
return repos, count, sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&repos)
|
return repos, count, sess.Distinct("repo.*").Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&repos)
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeleteOldRepositoryArchives() {
|
func DeleteOldRepositoryArchives() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user