Update deps

This commit is contained in:
Jeff Mitchell
2017-02-24 14:36:54 -05:00
parent a4d535c9c1
commit ec7ec42e4c
146 changed files with 2195 additions and 4457 deletions

View File

@@ -5,7 +5,10 @@
package github
import "fmt"
import (
"context"
"fmt"
)
// Tree represents a GitHub tree.
type Tree struct {
@@ -35,8 +38,8 @@ func (t TreeEntry) String() string {
// GetTree fetches the Tree object for a given sha hash from a repository.
//
// GitHub API docs: http://developer.github.com/v3/git/trees/#get-a-tree
func (s *GitService) GetTree(owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) {
// GitHub API docs: https://developer.github.com/v3/git/trees/#get-a-tree
func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha)
if recursive {
u += "?recursive=1"
@@ -48,7 +51,7 @@ func (s *GitService) GetTree(owner string, repo string, sha string, recursive bo
}
t := new(Tree)
resp, err := s.client.Do(req, t)
resp, err := s.client.Do(ctx, req, t)
if err != nil {
return nil, resp, err
}
@@ -66,8 +69,8 @@ type createTree struct {
// path modifying that tree are specified, it will overwrite the contents of
// that tree with the new path contents and write a new tree out.
//
// GitHub API docs: http://developer.github.com/v3/git/trees/#create-a-tree
func (s *GitService) CreateTree(owner string, repo string, baseTree string, entries []TreeEntry) (*Tree, *Response, error) {
// GitHub API docs: https://developer.github.com/v3/git/trees/#create-a-tree
func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []TreeEntry) (*Tree, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo)
body := &createTree{
@@ -80,7 +83,7 @@ func (s *GitService) CreateTree(owner string, repo string, baseTree string, entr
}
t := new(Tree)
resp, err := s.client.Do(req, t)
resp, err := s.client.Do(ctx, req, t)
if err != nil {
return nil, resp, err
}