]> source.dussan.org Git - gitea.git/commitdiff
Get repo list with OrderBy alpha should respect owner too (#30784) (#30875)
authorGiteabot <teabot@gitea.io>
Mon, 6 May 2024 15:06:45 +0000 (23:06 +0800)
committerGitHub <noreply@github.com>
Mon, 6 May 2024 15:06:45 +0000 (15:06 +0000)
Backport #30784 by @6543

instead of:
- zowner/gcode
- awesome/nul
- zowner/nul
- zowner/zzz

we will get:
- awesome/nul
- zowner/gcode
- zowner/nul
- zowner/zzz

Co-authored-by: 6543 <6543@obermui.de>
models/repo/search.go

index 4d64acf8cfe37b5631a2015d6fc7be1ff3236eb4..54d6dcfb440c9ec1b647654e379930a766d294bc 100644 (file)
@@ -8,14 +8,14 @@ import "code.gitea.io/gitea/models/db"
 // SearchOrderByMap represents all possible search order
 var SearchOrderByMap = map[string]map[string]db.SearchOrderBy{
        "asc": {
-               "alpha":   db.SearchOrderByAlphabetically,
+               "alpha":   "owner_name ASC, name ASC",
                "created": db.SearchOrderByOldest,
                "updated": db.SearchOrderByLeastUpdated,
                "size":    db.SearchOrderBySize,
                "id":      db.SearchOrderByID,
        },
        "desc": {
-               "alpha":   db.SearchOrderByAlphabeticallyReverse,
+               "alpha":   "owner_name DESC, name DESC",
                "created": db.SearchOrderByNewest,
                "updated": db.SearchOrderByRecentUpdated,
                "size":    db.SearchOrderBySizeReverse,