aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/git_blobs.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/git_blobs.go')
-rw-r--r--vendor/github.com/google/go-github/github/git_blobs.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/github.com/google/go-github/github/git_blobs.go b/vendor/github.com/google/go-github/github/git_blobs.go
index 5a46708..67ea74a 100644
--- a/vendor/github.com/google/go-github/github/git_blobs.go
+++ b/vendor/github.com/google/go-github/github/git_blobs.go
@@ -5,7 +5,10 @@
package github
-import "fmt"
+import (
+ "context"
+ "fmt"
+)
// Blob represents a blob object.
type Blob struct {
@@ -19,7 +22,7 @@ type Blob struct {
// GetBlob fetchs a blob from a repo given a SHA.
//
// GitHub API docs: https://developer.github.com/v3/git/blobs/#get-a-blob
-func (s *GitService) GetBlob(owner string, repo string, sha string) (*Blob, *Response, error) {
+func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -27,14 +30,14 @@ func (s *GitService) GetBlob(owner string, repo string, sha string) (*Blob, *Res
}
blob := new(Blob)
- resp, err := s.client.Do(req, blob)
+ resp, err := s.client.Do(ctx, req, blob)
return blob, resp, err
}
// CreateBlob creates a blob object.
//
// GitHub API docs: https://developer.github.com/v3/git/blobs/#create-a-blob
-func (s *GitService) CreateBlob(owner string, repo string, blob *Blob) (*Blob, *Response, error) {
+func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo)
req, err := s.client.NewRequest("POST", u, blob)
if err != nil {
@@ -42,6 +45,6 @@ func (s *GitService) CreateBlob(owner string, repo string, blob *Blob) (*Blob, *
}
t := new(Blob)
- resp, err := s.client.Do(req, t)
+ resp, err := s.client.Do(ctx, req, t)
return t, resp, err
}