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

appview: knotclient: return RepoBranchesResponse in Branches

Changed files
+4 -4
appview
+2 -2
appview/state/pull.go
···
result, err := us.Branches(f.OwnerDid(), f.RepoName)
if err != nil {
-
log.Println("failed to reach knotserver", err)
+
log.Println("failed to fetch branches", err)
return
}
···
return
-
branches := result.Branches
+
branches := result.Branches
sort.Slice(branches, func(i int, j int) bool {
return branches[i].Commit.Committer.When.After(branches[j].Commit.Committer.When)
})
+2 -2
appview/state/repo.go
···
return nil, err
}
-
if !slices.ContainsFunc(result.Branches, func(branch types.Branch) bool {
+
if !slices.ContainsFunc(result.Branches, func(branch types.Branch) bool {
return branch.Name == f.Ref
}) {
forkInfo.Status = types.MissingBranch
···
return
}
-
slices.SortFunc(result.Branches, func(a, b types.Branch) int {
+
slices.SortFunc(result.Branches, func(a, b types.Branch) int {
if a.IsDefault {
return -1
}