diff --git a/appview/state/pull.go b/appview/state/pull.go index 4c6ee51..ee1d224 100644 --- a/appview/state/pull.go +++ b/appview/state/pull.go @@ -629,7 +629,7 @@ func (s *State) NewPull(w http.ResponseWriter, r *http.Request) { 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 } @@ -1143,7 +1143,7 @@ func (s *State) CompareBranchesFragment(w http.ResponseWriter, r *http.Request) 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) }) diff --git a/appview/state/repo.go b/appview/state/repo.go index 069ad5a..0c46c3f 100644 --- a/appview/state/repo.go +++ b/appview/state/repo.go @@ -185,7 +185,7 @@ func getForkInfo( 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 @@ -556,7 +556,7 @@ func (s *State) RepoBranches(w http.ResponseWriter, r *http.Request) { 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 }