aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/repos_forks.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/repos_forks.go')
-rw-r--r--vendor/github.com/google/go-github/github/repos_forks.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/github.com/google/go-github/github/repos_forks.go b/vendor/github.com/google/go-github/github/repos_forks.go
index fe98a6c..6b5e4ea 100644
--- a/vendor/github.com/google/go-github/github/repos_forks.go
+++ b/vendor/github.com/google/go-github/github/repos_forks.go
@@ -5,7 +5,10 @@
package github
-import "fmt"
+import (
+ "context"
+ "fmt"
+)
// RepositoryListForksOptions specifies the optional parameters to the
// RepositoriesService.ListForks method.
@@ -20,7 +23,7 @@ type RepositoryListForksOptions struct {
// ListForks lists the forks of the specified repository.
//
// GitHub API docs: https://developer.github.com/v3/repos/forks/#list-forks
-func (s *RepositoriesService) ListForks(owner, repo string, opt *RepositoryListForksOptions) ([]*Repository, *Response, error) {
+func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opt *RepositoryListForksOptions) ([]*Repository, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/forks", owner, repo)
u, err := addOptions(u, opt)
if err != nil {
@@ -33,7 +36,7 @@ func (s *RepositoriesService) ListForks(owner, repo string, opt *RepositoryListF
}
var repos []*Repository
- resp, err := s.client.Do(req, &repos)
+ resp, err := s.client.Do(ctx, req, &repos)
if err != nil {
return nil, resp, err
}
@@ -57,7 +60,7 @@ type RepositoryCreateForkOptions struct {
// in a successful request.
//
// GitHub API docs: https://developer.github.com/v3/repos/forks/#create-a-fork
-func (s *RepositoriesService) CreateFork(owner, repo string, opt *RepositoryCreateForkOptions) (*Repository, *Response, error) {
+func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opt *RepositoryCreateForkOptions) (*Repository, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/forks", owner, repo)
u, err := addOptions(u, opt)
if err != nil {
@@ -70,7 +73,7 @@ func (s *RepositoriesService) CreateFork(owner, repo string, opt *RepositoryCrea
}
fork := new(Repository)
- resp, err := s.client.Do(req, fork)
+ resp, err := s.client.Do(ctx, req, fork)
if err != nil {
return nil, resp, err
}