|
|
@@ -2,6 +2,7 @@ package gitote
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
+ "net/http"
|
|
|
)
|
|
|
|
|
|
// CommitMeta contains meta information of a commit in terms of API.
|
|
|
@@ -40,3 +41,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
|
|
|
+}
|