forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: repo/index: sort default branch to always be on top

Changed files
+6
appview
state
+6
appview/state/repo.go
···
if a.IsDefault {
return -1
}
if a.Commit != nil {
if a.Commit.Author.When.Before(b.Commit.Author.When) {
return 1
···
slices.SortFunc(result.Branches, func(a, b types.Branch) int {
if a.IsDefault {
return -1
}
if a.Commit != nil {
if a.Commit.Author.When.Before(b.Commit.Author.When) {
···
if a.IsDefault {
return -1
}
+
if b.IsDefault {
+
return 1
+
}
if a.Commit != nil {
if a.Commit.Author.When.Before(b.Commit.Author.When) {
return 1
···
slices.SortFunc(result.Branches, func(a, b types.Branch) int {
if a.IsDefault {
return -1
+
}
+
if b.IsDefault {
+
return 1
}
if a.Commit != nil {
if a.Commit.Author.When.Before(b.Commit.Author.When) {