mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-25 06:15:01 +00:00
Bump deps
This commit is contained in:
29
vendor/github.com/google/go-github/github/repos_commits.go
generated
vendored
29
vendor/github.com/google/go-github/github/repos_commits.go
generated
vendored
@@ -140,10 +140,9 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin
|
||||
}
|
||||
|
||||
// GetCommit fetches the specified commit, including all details about it.
|
||||
// todo: support media formats - https://github.com/google/go-github/issues/6
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/commits/#get-a-single-commit
|
||||
// See also: https://developer.github.com//v3/git/commits/#get-a-single-commit provides the same functionality
|
||||
// See also: https://developer.github.com/v3/git/commits/#get-a-single-commit provides the same functionality
|
||||
func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string) (*RepositoryCommit, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha)
|
||||
|
||||
@@ -164,6 +163,32 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st
|
||||
return commit, resp, nil
|
||||
}
|
||||
|
||||
// GetCommitRaw fetches the specified commit in raw (diff or patch) format.
|
||||
func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opt RawOptions) (string, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha)
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
switch opt.Type {
|
||||
case Diff:
|
||||
req.Header.Set("Accept", mediaTypeV3Diff)
|
||||
case Patch:
|
||||
req.Header.Set("Accept", mediaTypeV3Patch)
|
||||
default:
|
||||
return "", nil, fmt.Errorf("unsupported raw type %d", opt.Type)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
resp, err := s.client.Do(ctx, req, &buf)
|
||||
if err != nil {
|
||||
return "", resp, err
|
||||
}
|
||||
|
||||
return buf.String(), resp, nil
|
||||
}
|
||||
|
||||
// GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is
|
||||
// supplied and no new commits have occurred, a 304 Unmodified response is returned.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user