aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/single.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/single.go')
-rw-r--r--routers/repo/single.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index fdc4e6e7..625fe9f1 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -13,6 +13,26 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+func Branches(ctx *middleware.Context, params martini.Params) {
+ if !ctx.Repo.IsValid {
+ return
+ }
+
+ ctx.Data["Username"] = params["username"]
+ ctx.Data["Reponame"] = params["reponame"]
+
+ brs, err := models.GetBranches(params["username"], params["reponame"])
+ if err != nil {
+ ctx.Handle(200, "repo.Branches", err)
+ return
+ }
+
+ ctx.Data["Branches"] = brs
+ ctx.Data["IsRepoToolbarBranches"] = true
+
+ ctx.Render.HTML(200, "repo/branches", ctx.Data)
+}
+
func Single(ctx *middleware.Context, params martini.Params) {
if !ctx.Repo.IsValid {
return