summaryrefslogtreecommitdiffstats
path: root/modules/middleware/repo.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-14 14:12:21 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-14 14:12:21 +0800
commit5acc948562547b393ba1e89b012e7421143c6dd8 (patch)
tree657653112b206fb01ff184bd30cb680b5b5a21fa /modules/middleware/repo.go
parent2935ee440c82a7f998a74159255cc38924f6e0bc (diff)
downloadgitea-5acc948562547b393ba1e89b012e7421143c6dd8.tar.gz
gitea-5acc948562547b393ba1e89b012e7421143c6dd8.zip
Page: `/org/:orgname/settings`
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r--modules/middleware/repo.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 929850d202..a028aab802 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -20,15 +20,13 @@ import (
func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
return func(ctx *Context) {
- // To valid brach name.
- var validBranch bool
- // To display bare quick start if it is a bare repo.
- var displayBare bool
-
+ var (
+ validBranch bool // To valid brach name.
+ displayBare bool // To display bare page if it is a bare repo.
+ )
if len(args) >= 1 {
validBranch = args[0]
}
-
if len(args) >= 2 {
displayBare = args[1]
}
@@ -60,12 +58,11 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
if err != nil {
if err == models.ErrUserNotExist {
ctx.Handle(404, "GetUserByName", err)
- return
} else if redirect {
ctx.Redirect("/")
- return
+ } else {
+ ctx.Handle(500, "GetUserByName", err)
}
- ctx.Handle(500, "GetUserByName", err)
return
}
} else {