aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/gogs/go-gogs-client/repo_branch.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-05-27 09:07:15 +0800
committerUnknwon <u@gogs.io>2018-05-27 09:07:15 +0800
commite33d9e77f43e6829ea967e47964d13f5a8aec5cc (patch)
treeace1a09414a66fd7e293b3837865633168ba4f6e /vendor/github.com/gogs/go-gogs-client/repo_branch.go
parentaff42082441715559bb2e62e11550af1a946a8c9 (diff)
vendor: rename "gogits" to "gogs"
Diffstat (limited to 'vendor/github.com/gogs/go-gogs-client/repo_branch.go')
-rw-r--r--vendor/github.com/gogs/go-gogs-client/repo_branch.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/github.com/gogs/go-gogs-client/repo_branch.go b/vendor/github.com/gogs/go-gogs-client/repo_branch.go
new file mode 100644
index 00000000..1e581121
--- /dev/null
+++ b/vendor/github.com/gogs/go-gogs-client/repo_branch.go
@@ -0,0 +1,25 @@
+// Copyright 2016 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
+
+import (
+ "fmt"
+)
+
+// Branch represents a repository branch.
+type Branch struct {
+ Name string `json:"name"`
+ Commit *PayloadCommit `json:"commit"`
+}
+
+func (c *Client) ListRepoBranches(user, repo string) ([]*Branch, error) {
+ branches := make([]*Branch, 0, 10)
+ return branches, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches", user, repo), nil, nil, &branches)
+}
+
+func (c *Client) GetRepoBranch(user, repo, branch string) (*Branch, error) {
+ b := new(Branch)
+ return b, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches/%s", user, repo, branch), nil, nil, &b)
+}