aboutsummaryrefslogtreecommitdiff
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-20 11:41:24 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-20 11:41:24 -0400
commit3b387336bfc097090d5b03f5b01e136bca56f8fd (patch)
tree70b21fa35d162a011b6a154fab4579c9491d7245 /routers/repo
parent1a0d7c54a2abecbe5335ca374fd8a345c2e7d3fd (diff)
Add Repository/user name filter
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/repo.go3
-rw-r--r--routers/repo/single.go5
2 files changed, 8 insertions, 0 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 556cc434..c83a6df5 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -31,6 +31,9 @@ func Create(ctx *middleware.Context, form auth.CreateRepoForm) {
} else if err == models.ErrRepoAlreadyExist {
ctx.RenderWithErr("Repository name has already been used", "repo/create", &form)
return
+ } else if err == models.ErrRepoNameIllegal {
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "repo/create", &form)
+ return
}
ctx.Handle(200, "repo.Create", err)
}
diff --git a/routers/repo/single.go b/routers/repo/single.go
index f1b15cce..eab49be9 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -217,6 +217,11 @@ func Setting(ctx *middleware.Context, params martini.Params) {
title = t
}
+ if len(params["branchname"]) == 0 {
+ params["branchname"] = "master"
+ }
+
+ ctx.Data["Branchname"] = params["branchname"]
ctx.Data["Title"] = title + " - settings"
ctx.HTML(200, "repo/setting")
}