diff options
author | Unknwon <u@gogs.io> | 2018-12-16 19:48:34 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2018-12-16 19:48:34 -0500 |
commit | c82ac420fc86f454700f9f6e6148ed27a6f185cd (patch) | |
tree | aaf04bca4108a6229faa35a160b85fa9b1c36f53 /vendor/github.com/gogs | |
parent | f91cb9321e06cf3570ca373e16ca84804ef7950a (diff) |
vendor: update
- github.com/gogs/go-gogs-client
- gopkg.in/macaron.v1
Diffstat (limited to 'vendor/github.com/gogs')
-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 +} |