go-github
go-github copied to clipboard
RepositoriesService.ListCommits does not get list of commits on a non-default branch
ListCommits uses following line to construct the url
u := fmt.Sprintf("repos/%v/%v/commits", owner, repo)
There is no way to specify branch name to the function and hence the list of commits returned are only from the default branch
If you search for the word "branch" you will find the SHA field of CommitsListOptions here:
https://github.com/google/go-github/blob/master/github/repos_commits.go#L97-L101
which should do what you want.