diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-06-20 22:39:07 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-06-20 22:39:07 +0100 |
commit | de6d2c524430287c699aaa898c1325da6afea539 (patch) | |
tree | f78eb841208d667668a7bc92a9290d693cc7103b /vendor/github.com/google/go-github/github/git_refs.go | |
parent | eb99016e1629e690e55633de6fc63a14c53e7ea2 (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/google/go-github/github/git_refs.go')
-rw-r--r-- | vendor/github.com/google/go-github/github/git_refs.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/github.com/google/go-github/github/git_refs.go b/vendor/github.com/google/go-github/github/git_refs.go index e78fdc6..0947d86 100644 --- a/vendor/github.com/google/go-github/github/git_refs.go +++ b/vendor/github.com/google/go-github/github/git_refs.go @@ -18,6 +18,7 @@ type Reference struct { Ref *string `json:"ref"` URL *string `json:"url"` Object *GitObject `json:"object"` + NodeID *string `json:"node_id,omitempty"` } func (r Reference) String() string { @@ -62,6 +63,9 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) + r := new(Reference) resp, err := s.client.Do(ctx, req, r) if _, ok := err.(*json.UnmarshalTypeError); ok { @@ -93,6 +97,9 @@ func (s *GitService) GetRefs(ctx context.Context, owner string, repo string, ref return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) + var rawJSON json.RawMessage resp, err := s.client.Do(ctx, req, &rawJSON) if err != nil { @@ -147,6 +154,9 @@ func (s *GitService) ListRefs(ctx context.Context, owner, repo string, opt *Refe return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) + var rs []*Reference resp, err := s.client.Do(ctx, req, &rs) if err != nil { @@ -170,6 +180,9 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) + r := new(Reference) resp, err := s.client.Do(ctx, req, r) if err != nil { @@ -193,6 +206,9 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview) + r := new(Reference) resp, err := s.client.Do(ctx, req, r) if err != nil { |