1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor editorconfig middleware

This commit is contained in:
Andrey Nering
2016-11-05 13:58:53 -02:00
parent 91b589f2f0
commit bd898a10f8
5 changed files with 8 additions and 27 deletions

View File

@@ -179,11 +179,6 @@ func Diff(ctx *context.Context) {
}
}
setEditorconfigIfExists(ctx)
if ctx.Written() {
return
}
ctx.Data["CommitID"] = commitID
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["Username"] = userName

View File

@@ -8,7 +8,7 @@ import (
"github.com/gogits/git-module"
)
func setEditorconfigIfExists(ctx *context.Context) {
func SetEditorconfigIfExists(ctx *context.Context) {
ec, err := ctx.Repo.GetEditorconfig()
if err != nil && !git.IsErrNotExist(err) {

View File

@@ -368,11 +368,6 @@ func ViewPullFiles(ctx *context.Context) {
return
}
setEditorconfigIfExists(ctx)
if ctx.Written() {
return
}
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name)
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["Username"] = pull.HeadUserName
@@ -625,11 +620,6 @@ func CompareAndPullRequest(ctx *context.Context) {
}
}
setEditorconfigIfExists(ctx)
if ctx.Written() {
return
}
ctx.HTML(200, COMPARE_PULL)
}

View File

@@ -245,11 +245,6 @@ func Home(ctx *context.Context) {
return
}
setEditorconfigIfExists(ctx)
if ctx.Written() {
return
}
var treeNames []string
paths := make([]string, 0, 5)
if len(ctx.Repo.TreePath) > 0 {