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

appview: knotclient: return RepoBranchesResponse in Branches

authored by anirudh.fi and committed by Tangled 26c62f52 386f9035

Changed files
+4 -4
appview
+2 -2
appview/state/pull.go
··· 629 629 630 630 result, err := us.Branches(f.OwnerDid(), f.RepoName) 631 631 if err != nil { 632 - log.Println("failed to reach knotserver", err) 632 + log.Println("failed to fetch branches", err) 633 633 return 634 634 } 635 635 ··· 1143 1143 return 1144 1144 } 1145 1145 1146 - branches := result.Branches 1146 + branches := result.Branches 1147 1147 sort.Slice(branches, func(i int, j int) bool { 1148 1148 return branches[i].Commit.Committer.When.After(branches[j].Commit.Committer.When) 1149 1149 })
+2 -2
appview/state/repo.go
··· 185 185 return nil, err 186 186 } 187 187 188 - if !slices.ContainsFunc(result.Branches, func(branch types.Branch) bool { 188 + if !slices.ContainsFunc(result.Branches, func(branch types.Branch) bool { 189 189 return branch.Name == f.Ref 190 190 }) { 191 191 forkInfo.Status = types.MissingBranch ··· 556 556 return 557 557 } 558 558 559 - slices.SortFunc(result.Branches, func(a, b types.Branch) int { 559 + slices.SortFunc(result.Branches, func(a, b types.Branch) int { 560 560 if a.IsDefault { 561 561 return -1 562 562 }