1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

feat: Only use issue and wiki on repo. (#1297)

This commit is contained in:
Bo-Yi Wu
2017-03-18 05:59:07 -05:00
committed by Lunny Xiao
parent 5ecb369dac
commit 1c3bd436cc
7 changed files with 32 additions and 40 deletions

View File

@@ -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,15 +153,8 @@ 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
}