dmitri.shuralyov.com/service/change/githubapi

Use larger page size for ListCommits call.

Page size 100 is largest allowed.

Add full pagination later if/when needed.
dmitshur committed 6 years ago commit c74edf3a9b92e02fd7da1abcd5a3a7632fa3f353
Showing partial commit. Full Commit
Collapse all
githubapi/githubapi.go
@@ -210,11 +210,11 @@ func (s service) ListCommits(ctx context.Context, rs string, id uint64) ([]chang
	repo, err := ghRepoSpec(rs)
	if err != nil {
		// TODO: Map to 400 Bad Request HTTP error.
		return nil, err
	}
	cs, _, err := s.clV3.PullRequests.ListCommits(ctx, repo.Owner, repo.Repo, int(id), nil)
	cs, _, err := s.clV3.PullRequests.ListCommits(ctx, repo.Owner, repo.Repo, int(id), &github.ListOptions{PerPage: 100}) // TODO: Pagination.
	if err != nil {
		return nil, err
	}
	var commits []change.Commit
	for _, c := range cs {