aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 82956098..b05ce4a7 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -69,7 +69,10 @@ func Branches(ctx *middleware.Context, params martini.Params) {
ctx.Data["Username"] = params["username"]
ctx.Data["Reponame"] = params["reponame"]
- ctx.Data["Branchname"] = brs[0]
+ if len(params["branchname"]) == 0 {
+ params["branchname"] = "master"
+ }
+ ctx.Data["Branchname"] = params["branchname"]
ctx.Data["Branches"] = brs
ctx.Data["IsRepoToolbarBranches"] = true
@@ -334,8 +337,13 @@ func Commits(ctx *middleware.Context, params martini.Params) {
ctx.HTML(200, "repo/commits")
}
-func Pulls(ctx *middleware.Context) {
+func Pulls(ctx *middleware.Context, params martini.Params) {
ctx.Data["IsRepoToolbarPulls"] = true
+ if len(params["branchname"]) == 0 {
+ params["branchname"] = "master"
+ }
+
+ ctx.Data["Branchname"] = params["branchname"]
ctx.HTML(200, "repo/pulls")
}