diff options
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/gogs/go-gogs-client/media_types.go | 9 | ||||
-rw-r--r-- | vendor/github.com/gogs/go-gogs-client/repo_commit.go | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/vendor/github.com/gogs/go-gogs-client/media_types.go b/vendor/github.com/gogs/go-gogs-client/media_types.go new file mode 100644 index 00000000..884a8a74 --- /dev/null +++ b/vendor/github.com/gogs/go-gogs-client/media_types.go @@ -0,0 +1,9 @@ +// Copyright 2018 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package gogs + +const ( + MediaApplicationSHA = "application/vnd.gogs.sha" +) diff --git a/vendor/github.com/gogs/go-gogs-client/repo_commit.go b/vendor/github.com/gogs/go-gogs-client/repo_commit.go index bd1a0804..b415962a 100644 --- a/vendor/github.com/gogs/go-gogs-client/repo_commit.go +++ b/vendor/github.com/gogs/go-gogs-client/repo_commit.go @@ -6,6 +6,7 @@ package gogs import ( "fmt" + "net/http" ) // CommitMeta contains meta information of a commit in terms of API. @@ -44,3 +45,9 @@ func (c *Client) GetSingleCommit(user, repo, commitID string) (*Commit, error) { commit := new(Commit) return commit, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/commits/%s", user, repo, commitID), nil, nil, &commit) } + +func (c *Client) GetReferenceSHA(user, repo, ref string) (string, error) { + data, err := c.getResponse("GET", fmt.Sprintf("/repos/%s/%s/commits/%s", user, repo, ref), + http.Header{"Accept": []string{MediaApplicationSHA}}, nil) + return string(data), err +} |