mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 03:21:49 +01:00
Update link for documentation (Temporary https://gist.github.com/sapk/df64347ff218baf4a277)
[ci skip]
This commit is contained in:
parent
c11c3b6c11
commit
303d091ea9
1 changed files with 4 additions and 7 deletions
|
@ -5,15 +5,14 @@
|
||||||
package repo
|
package repo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
//TODO change for merge
|
|
||||||
api "github.com/gogits/go-gogs-client"
|
api "github.com/gogits/go-gogs-client"
|
||||||
|
|
||||||
"github.com/gogits/gogs/modules/middleware"
|
"github.com/gogits/gogs/modules/middleware"
|
||||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||||
)
|
)
|
||||||
|
|
||||||
//TODO add to github.com/gogits/go-gogs-client
|
// Temporary: https://gist.github.com/sapk/df64347ff218baf4a277#get-a-branch
|
||||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#get-branch
|
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Branches#get-a-branch
|
||||||
func GetBranch(ctx *middleware.Context) {
|
func GetBranch(ctx *middleware.Context) {
|
||||||
branch, err := ctx.Repo.Repository.GetBranch(ctx.Params(":id"))
|
branch, err := ctx.Repo.Repository.GetBranch(ctx.Params(":id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -28,11 +27,9 @@ func GetBranch(ctx *middleware.Context) {
|
||||||
ctx.JSON(200, convert.ToApiBranch(branch,c))
|
ctx.JSON(200, convert.ToApiBranch(branch,c))
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO add to github.com/gogits/go-gogs-client
|
// Temporary: https://gist.github.com/sapk/df64347ff218baf4a277#list-branches
|
||||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-branches
|
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Branches#list-branches
|
||||||
func ListBranches(ctx *middleware.Context) {
|
func ListBranches(ctx *middleware.Context) {
|
||||||
|
|
||||||
|
|
||||||
Branches, err := ctx.Repo.Repository.GetBranches()
|
Branches, err := ctx.Repo.Repository.GetBranches()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//TODO handle error
|
//TODO handle error
|
||||||
|
|
Loading…
Reference in a new issue