summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-03-18 05:59:07 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-18 18:59:07 +0800
commit1c3bd436ccbe3852541dc7162df41632658769db (patch)
tree4ee965f43e0dee397c05557329bf524974cd94a4 /modules/context
parent5ecb369dacb929c218399379350fa2ecb05693ae (diff)
downloadgitea-1c3bd436ccbe3852541dc7162df41632658769db.tar.gz
gitea-1c3bd436ccbe3852541dc7162df41632658769db.zip
feat: Only use issue and wiki on repo. (#1297)
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/repo.go20
1 files changed, 2 insertions, 18 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 895640a823..aae76185e2 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -12,7 +12,6 @@ import (
"code.gitea.io/git"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/Unknwon/com"
editorconfig "gopkg.in/editorconfig/editorconfig-core-go.v1"
@@ -154,16 +153,9 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
}
// RepoAssignment returns a macaron to handle repository assignment
-func RepoAssignment(args ...bool) macaron.Handler {
+func RepoAssignment() macaron.Handler {
return func(ctx *Context) {
var (
- displayBare bool // To display bare page if it is a bare repo.
- )
- if len(args) >= 1 {
- displayBare = args[0]
- }
-
- var (
owner *models.User
err error
)
@@ -294,15 +286,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
// repo is bare and display enable
if ctx.Repo.Repository.IsBare {
- log.Debug("Bare repository: %s", ctx.Repo.RepoLink)
- // NOTE: to prevent templating error
- ctx.Data["BranchName"] = ""
- if displayBare {
- if !ctx.Repo.IsAdmin() {
- ctx.Flash.Info(ctx.Tr("repo.repo_is_empty"), true)
- }
- ctx.HTML(200, "repo/bare")
- }
+ ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
return
}