File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -107,17 +107,13 @@ func (opts FindBranchOptions) ToConds() builder.Cond {
107
107
108
108
func (opts FindBranchOptions ) ToOrders () string {
109
109
orderBy := opts .OrderBy
110
- if opts .IsDeletedBranch .ValueOrDefault (true ) { // if deleted branch included, put them at the end
111
- if orderBy != "" {
112
- orderBy += ", "
113
- }
114
- orderBy += "is_deleted ASC"
115
- }
116
110
if orderBy == "" {
117
111
// the commit_time might be the same, so add the "name" to make sure the order is stable
118
- return "commit_time DESC, name ASC"
112
+ orderBy = "commit_time DESC, name ASC"
113
+ }
114
+ if opts .IsDeletedBranch .ValueOrDefault (true ) { // if deleted branch included, put them at the beginning
115
+ orderBy = "is_deleted ASC, " + orderBy
119
116
}
120
-
121
117
return orderBy
122
118
}
123
119
You can’t perform that action at this time.
0 commit comments