go-github icon indicating copy to clipboard operation
go-github copied to clipboard

RepositoriesService.ListCommits does not get list of commits on a non-default branch

Open pralim opened this issue 3 years ago • 1 comments

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

pralim avatar Sep 23 '22 13:09 pralim

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.

gmlewis avatar Sep 23 '22 20:09 gmlewis