prow/github/client.go
func (c *Client) ListPRCommits(org, repo string, number int) ([]RepositoryCommit, error) {
	c.log("ListPRCommits", org, repo, number)
	if c.fake {
		return nil, nil
	}
	var commits []RepositoryCommit
	err := c.readPaginatedResults(
		fmt.Sprintf("/repos/%v/%v/pulls/%d/commits", org, repo, number),
		acceptNone,
		func() interface{} { // newObj returns a pointer to the type of object to create
			return &[]RepositoryCommit{}
		},
		func(obj interface{}) { // accumulate is the accumulation function for paginated results
			commits = append(commits, *(obj.(*[]RepositoryCommit))...)
		},
	)
	if err != nil {
		return nil, err
	}
	return commits, nil
}
func (c *Client) ListPRCommits(org, repo string, number int) ([]RepositoryCommit, error) {
	c.log("ListPRCommits", org, repo, number)
	if c.fake {
		return nil, nil
	}
	var commits []RepositoryCommit
	err := c.readPaginatedResults(
		fmt.Sprintf("/repos/%v/%v/pulls/%d/commits", org, repo, number),
		acceptNone,
		func() interface{} { // newObj returns a pointer to the type of object to create
			return &[]RepositoryCommit{}
		},
		func(obj interface{}) { // accumulate is the accumulation function for paginated results
			commits = append(commits, *(obj.(*[]RepositoryCommit))...)
		},
	)
	if err != nil {
		return nil, err
	}
	return commits, nil
}
func ( c * Client ) ListPRCommits ( org , repo string , number int ) ( [ ] RepositoryCommit , error ) { c . log ( " " , org , repo , number ) if c . fake { return nil , nil } var commits [ ] RepositoryCommit err := c . readPaginatedResults ( fmt . Sprintf ( " " , org , repo , number ) , acceptNone , func ( ) interface { } { // newObj returns a pointer to the type of object to create return & [ ] RepositoryCommit { } } , func ( obj interface { } ) { // accumulate is the accumulation function for paginated results commits = append ( commits , * ( obj . ( * [ ] RepositoryCommit ) ) ... ) } , ) if err != nil { return nil , err } return commits , nil }
// ListPRCommits lists the commits in a pull request.
//
// GitHub API docs: https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
ListPRCommits lists the commits in a pull request . GitHub API docs : https : // developer . github . com / v3 / pulls / #list - commits - on - a - pull - request