diff --git a/github/repos_commits.go b/github/repos_commits.go index c1359f4..d7be0e2 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -48,13 +48,16 @@ func (c CommitStats) String() string { // CommitFile represents a file modified in a commit. type CommitFile struct { - SHA *string `json:"sha,omitempty"` - Filename *string `json:"filename,omitempty"` - Additions *int `json:"additions,omitempty"` - Deletions *int `json:"deletions,omitempty"` - Changes *int `json:"changes,omitempty"` - Status *string `json:"status,omitempty"` - Patch *string `json:"patch,omitempty"` + SHA *string `json:"sha,omitempty"` + Filename *string `json:"filename,omitempty"` + Additions *int `json:"additions,omitempty"` + Deletions *int `json:"deletions,omitempty"` + Changes *int `json:"changes,omitempty"` + Status *string `json:"status,omitempty"` + Patch *string `json:"patch,omitempty"` + BlobURL *string `json:"blob_url,omitempty"` + RawURL *string `json:"raw_url,omitempty"` + ContentsURL *string `json:"contents_url,omitempty"` } func (c CommitFile) String() string { diff --git a/github/repos_commits_test.go b/github/repos_commits_test.go index 771cd9f..47224df 100644 --- a/github/repos_commits_test.go +++ b/github/repos_commits_test.go @@ -70,9 +70,10 @@ func TestRepositoriesService_GetCommit(t *testing.T) { "deletions": 2, "changes": 12, "status": "s", - "raw_url": "r", + "patch": "p", "blob_url": "b", - "patch": "p" + "raw_url": "r", + "contents_url": "c" } ] }`) @@ -106,12 +107,15 @@ func TestRepositoriesService_GetCommit(t *testing.T) { }, Files: []CommitFile{ { - Filename: String("f"), - Additions: Int(10), - Deletions: Int(2), - Changes: Int(12), - Status: String("s"), - Patch: String("p"), + Filename: String("f"), + Additions: Int(10), + Deletions: Int(2), + Changes: Int(12), + Status: String("s"), + Patch: String("p"), + BlobURL: String("b"), + RawURL: String("r"), + ContentsURL: String("c"), }, }, }