Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 10296af

Browse files
committed
Create repo_branches.go
1 parent 2f4342d commit 10296af

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

repo_branches.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package gogs
2+
3+
type Branch struct {
4+
name string `json:"name"`
5+
commit *PayloadCommit `json:"commit"`
6+
}
7+
8+
func (c *Client) ListRepoBranches(user, repo string) ([]*Branch, error) {
9+
branches := make([]*Branch, 0, 10)
10+
return branches, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches", user, repo), nil, nil, &branches)
11+
}
12+
13+
func (c *Client) GetRepoBranch(user, repo, branch string) (*Branch, error) {
14+
b := new(Branch)
15+
return b, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches/%s", user, repo, branch), nil, nil, &b)
16+
}

0 commit comments

Comments
 (0)