vendor: update

- github.com/gogs/go-gogs-client
- gopkg.in/macaron.v1
This commit is contained in:
Unknwon
2018-12-16 19:48:34 -05:00
parent f91cb9321e
commit c82ac420fc
6 changed files with 26 additions and 10 deletions

9
vendor/github.com/gogs/go-gogs-client/media_types.go generated vendored Normal file
View File

@@ -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"
)

View File

@@ -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
}