loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make FindBranches have stable result (#25631)

See the comment

authored by

wxiaoguang and committed by
GitHub
2aa6a785 7735da1c

+2 -6
+2 -6
models/git/branch_list.go
··· 64 64 return nil 65 65 } 66 66 67 - const ( 68 - BranchOrderByNameAsc = "name ASC" 69 - BranchOrderByCommitTimeDesc = "commit_time DESC" 70 - ) 71 - 72 67 type FindBranchOptions struct { 73 68 db.ListOptions 74 69 RepoID int64 ··· 102 97 } 103 98 104 99 if opts.OrderBy == "" { 105 - opts.OrderBy = BranchOrderByCommitTimeDesc 100 + // the commit_time might be the same, so add the "name" to make sure the order is stable 101 + opts.OrderBy = "commit_time DESC, name ASC" 106 102 } 107 103 return sess.OrderBy(opts.OrderBy) 108 104 }