Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions github/git_commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Commit struct {
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"`

Expand Down
88 changes: 24 additions & 64 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions github/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ type CommitsSearchResult struct {

// CommitResult represents a commit object as returned in commit search endpoint response.
type CommitResult struct {
Hash *string `json:"hash,omitempty"`
Message *string `json:"message,omitempty"`
AuthorID *int `json:"author_id,omitempty"`
AuthorName *string `json:"author_name,omitempty"`
AuthorEmail *string `json:"author_email,omitempty"`
AuthorDate *Timestamp `json:"author_date,omitempty"`
CommitterID *int `json:"committer_id,omitempty"`
CommitterName *string `json:"committer_name,omitempty"`
CommitterEmail *string `json:"committer_email,omitempty"`
CommitterDate *Timestamp `json:"committer_date,omitempty"`
Repository *Repository `json:"repository,omitempty"`
SHA *string `json:"sha,omitempty"`
Commit *Commit `json:"commit,omitempty"`
Author *User `json:"author,omitempty"`
Committer *User `json:"committer,omitempty"`
Parents []*Commit `json:"parents,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
URL *string `json:"url,omitempty"`
CommentsURL *string `json:"comments_url,omitempty"`

Repository *Repository `json:"repository,omitempty"`
Score *float64 `json:"score,omitempty"`
}

// Commits searches commits via various criteria.
Expand Down
4 changes: 2 additions & 2 deletions github/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestSearchService_Commits(t *testing.T) {
"order": "desc",
})

fmt.Fprint(w, `{"total_count": 4, "incomplete_results": false, "items": [{"hash":"random_hash1"},{"hash":"random_hash2"}]}`)
fmt.Fprint(w, `{"total_count": 4, "incomplete_results": false, "items": [{"sha":"random_hash1"},{"sha":"random_hash2"}]}`)
})

opts := &SearchOptions{Sort: "author-date", Order: "desc"}
Expand All @@ -71,7 +71,7 @@ func TestSearchService_Commits(t *testing.T) {
want := &CommitsSearchResult{
Total: Int(4),
IncompleteResults: Bool(false),
Commits: []*CommitResult{{Hash: String("random_hash1")}, {Hash: String("random_hash2")}},
Commits: []*CommitResult{{SHA: String("random_hash1")}, {SHA: String("random_hash2")}},
}
if !reflect.DeepEqual(result, want) {
t.Errorf("Search.Commits returned %+v, want %+v", result, want)
Expand Down