Skip to content

Commit

Permalink
Fix listing Gitea repos (#2768)
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s authored Nov 7, 2023
1 parent 52163b9 commit 9d5ef11
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions server/forge/gitea/gitea.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
return nil, err
}

return shared_utils.Paginate(func(page int) ([]*model.Repo, error) {
repos, err := shared_utils.Paginate(func(page int) ([]*gitea.Repository, error) {
repos, _, err := client.ListMyRepos(
gitea.ListReposOptions{
ListOptions: gitea.ListOptions{
Expand All @@ -268,15 +268,17 @@ func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
},
},
)
result := make([]*model.Repo, 0, len(repos))
for _, repo := range repos {
if repo.Archived {
continue
}
result = append(result, toRepo(repo))
}
return result, err
return repos, err
})

result := make([]*model.Repo, 0, len(repos))
for _, repo := range repos {
if repo.Archived {
continue
}
result = append(result, toRepo(repo))
}
return result, err
}

// File fetches the file from the Gitea repository and returns its contents.
Expand Down

0 comments on commit 9d5ef11

Please sign in to comment.