diff options
Diffstat (limited to 'vendor/github.com/google/go-github/github/git_commits.go')
-rw-r--r-- | vendor/github.com/google/go-github/github/git_commits.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/google/go-github/github/git_commits.go b/vendor/github.com/google/go-github/github/git_commits.go index 3c49a8a..2988256 100644 --- a/vendor/github.com/google/go-github/github/git_commits.go +++ b/vendor/github.com/google/go-github/github/git_commits.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "strings" "time" ) @@ -31,6 +32,7 @@ type Commit struct { 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 @@ -67,8 +69,9 @@ func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, s return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeGitSigningPreview) + // TODO: remove custom Accept headers when APIs fully launch. + acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) c := new(Commit) resp, err := s.client.Do(ctx, req, c) @@ -123,6 +126,9 @@ func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) + c := new(Commit) resp, err := s.client.Do(ctx, req, c) if err != nil { |