1
0
Fork 0
forked from forgejo/forgejo

update git api. fix link... and so on

This commit is contained in:
slene 2014-03-30 10:13:02 +08:00
parent 41ca0ed302
commit b27c34f39a
11 changed files with 63 additions and 91 deletions

View file

@ -11,21 +11,15 @@ import (
)
func Branches(ctx *middleware.Context, params martini.Params) {
if !ctx.Repo.IsValid {
return
}
brs, err := models.GetBranches(params["username"], params["reponame"])
brs, err := models.GetBranches(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
if err != nil {
ctx.Handle(200, "repo.Branches", err)
ctx.Handle(404, "repo.Branches", err)
return
} else if len(brs) == 0 {
ctx.Handle(404, "repo.Branches", nil)
return
}
ctx.Data["Username"] = params["username"]
ctx.Data["Reponame"] = params["reponame"]
ctx.Data["Branches"] = brs
ctx.Data["IsRepoToolbarBranches"] = true