-
Notifications
You must be signed in to change notification settings - Fork 2.2k
CommitStats in the Commit struct is always nil #3394
Copy link
Copy link
Closed
Description
The CommitStats in the Commit struct is always nil.
Comparing the current Commit struct:
go-github/github/git_commits.go
Lines 44 to 62 in c4a49db
| // Commit represents a GitHub commit. | |
| type Commit struct { | |
| SHA *string `json:"sha,omitempty"` | |
| Author *CommitAuthor `json:"author,omitempty"` | |
| Committer *CommitAuthor `json:"committer,omitempty"` | |
| Message *string `json:"message,omitempty"` | |
| Tree *Tree `json:"tree,omitempty"` | |
| Parents []*Commit `json:"parents,omitempty"` | |
| Stats *CommitStats `json:"stats,omitempty"` | |
| HTMLURL *string `json:"html_url,omitempty"` | |
| URL *string `json:"url,omitempty"` | |
| Verification *SignatureVerification `json:"verification,omitempty"` | |
| NodeID *string `json:"node_id,omitempty"` | |
| // CommentCount is the number of GitHub comments on the commit. This | |
| // is only populated for requests that fetch GitHub data like | |
| // Pulls.ListCommits, Repositories.ListCommits, etc. | |
| CommentCount *int `json:"comment_count,omitempty"` | |
| } |
The Stats field is not on the OpenAPI Contract.
I know that structs can be used to represents objects that look alike a lot (hence the CommentCount field).
So I'm not sure if the Stats field is also one of these exceptions. If that's the case, it should be explained just like CommentCount.
Reactions are currently unavailable
