Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pralim opened this issue Sep 23, 2022 · 2 comments

Comments

@pralim
Copy link

pralim commented Sep 23, 2022

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

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 23, 2022

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
Copy link
Collaborator

gmlewis commented Mar 17, 2025

Closing due to inactivity.

@gmlewis gmlewis closed this as completed Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants