aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/gogs/go-gogs-client/repo_commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gogs/go-gogs-client/repo_commit.go')
-rw-r--r--vendor/github.com/gogs/go-gogs-client/repo_commit.go7
1 files changed, 7 insertions, 0 deletions
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
+}