func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*RepositoryCommit, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var commits []*RepositoryCommit
	resp, err := s.client.Do(ctx, req, &commits)
	if err != nil {
		return nil, resp, err
	}
	return commits, resp, nil
}
ListCommits lists the commits in a pull request.

GitHub API docs: https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
package github
import (
	"bytes"
	"context"
	"fmt"
	"time"
)
type PullRequestsService service
type PullRequest struct {
	ID                *int       `json:"id,omitempty"`
	Number            *int       `json:"number,omitempty"`
	State             *string    `json:"state,omitempty"`
	Title             *string    `json:"title,omitempty"`
	Body              *string    `json:"body,omitempty"`
	CreatedAt         *time.Time `json:"created_at,omitempty"`
	UpdatedAt         *time.Time `json:"updated_at,omitempty"`
	ClosedAt          *time.Time `json:"closed_at,omitempty"`
	MergedAt          *time.Time `json:"merged_at,omitempty"`
	User              *User      `json:"user,omitempty"`
	Merged            *bool      `json:"merged,omitempty"`
	Mergeable         *bool      `json:"mergeable,omitempty"`
	MergedBy          *User      `json:"merged_by,omitempty"`
	Comments          *int       `json:"comments,omitempty"`
	Commits           *int       `json:"commits,omitempty"`
	Additions         *int       `json:"additions,omitempty"`
	Deletions         *int       `json:"deletions,omitempty"`
	ChangedFiles      *int       `json:"changed_files,omitempty"`
	URL               *string    `json:"url,omitempty"`
	HTMLURL           *string    `json:"html_url,omitempty"`
	IssueURL          *string    `json:"issue_url,omitempty"`
	StatusesURL       *string    `json:"statuses_url,omitempty"`
	DiffURL           *string    `json:"diff_url,omitempty"`
	PatchURL          *string    `json:"patch_url,omitempty"`
	ReviewCommentsURL *string    `json:"review_comments_url,omitempty"`
	ReviewCommentURL  *string    `json:"review_comment_url,omitempty"`
	Assignee          *User      `json:"assignee,omitempty"`
	Assignees         []*User    `json:"assignees,omitempty"`
	Milestone         *Milestone `json:"milestone,omitempty"`
	Head *PullRequestBranch `json:"head,omitempty"`
	Base *PullRequestBranch `json:"base,omitempty"`
}
func (p PullRequest) String() string {
	return Stringify(p)
}
type PullRequestBranch struct {
	Label *string     `json:"label,omitempty"`
	Ref   *string     `json:"ref,omitempty"`
	SHA   *string     `json:"sha,omitempty"`
	Repo  *Repository `json:"repo,omitempty"`
	User  *User       `json:"user,omitempty"`
}
type PullRequestListOptions struct {
	State string `url:"state,omitempty"`
	Head string `url:"head,omitempty"`
	Base string `url:"base,omitempty"`
	Sort string `url:"sort,omitempty"`
	Direction string `url:"direction,omitempty"`
	ListOptions
}
func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opt *PullRequestListOptions) ([]*PullRequest, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var pulls []*PullRequest
	resp, err := s.client.Do(ctx, req, &pulls)
	if err != nil {
		return nil, resp, err
	}
	return pulls, resp, nil
}
func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	pull := new(PullRequest)
	resp, err := s.client.Do(ctx, req, pull)
	if err != nil {
		return nil, resp, err
	}
	return pull, resp, nil
}
func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opt RawOptions) (string, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return "", nil, err
	}
	switch opt.Type {
	case Diff:
		req.Header.Set("Accept", mediaTypeV3Diff)
	case Patch:
		req.Header.Set("Accept", mediaTypeV3Patch)
	default:
		return "", nil, fmt.Errorf("unsupported raw type %d", opt.Type)
	}
	ret := new(bytes.Buffer)
	resp, err := s.client.Do(ctx, req, ret)
	if err != nil {
		return "", resp, err
	}
	return ret.String(), resp, nil
}
type NewPullRequest struct {
	Title *string `json:"title,omitempty"`
	Head  *string `json:"head,omitempty"`
	Base  *string `json:"base,omitempty"`
	Body  *string `json:"body,omitempty"`
	Issue *int    `json:"issue,omitempty"`
}
func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo)
	req, err := s.client.NewRequest("POST", u, pull)
	if err != nil {
		return nil, nil, err
	}
	p := new(PullRequest)
	resp, err := s.client.Do(ctx, req, p)
	if err != nil {
		return nil, resp, err
	}
	return p, resp, nil
}
type pullRequestUpdate struct {
	Title *string `json:"title,omitempty"`
	Body  *string `json:"body,omitempty"`
	State *string `json:"state,omitempty"`
	Base  *string `json:"base,omitempty"`
}
func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number)
	update := new(pullRequestUpdate)
	if pull != nil {
		update.Title = pull.Title
		update.Body = pull.Body
		update.State = pull.State
		if pull.Base != nil {
			update.Base = pull.Base.Ref
		}
	}
	req, err := s.client.NewRequest("PATCH", u, update)
	if err != nil {
		return nil, nil, err
	}
	p := new(PullRequest)
	resp, err := s.client.Do(ctx, req, p)
	if err != nil {
		return nil, resp, err
	}
	return p, resp, nil
}