summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/commit.go7
-rw-r--r--routers/repo/pull.go14
-rw-r--r--routers/repo/view.go6
3 files changed, 27 insertions, 0 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 4eb37e6bdb..c102ceae41 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -174,6 +174,13 @@ func Diff(ctx *context.Context) {
}
}
+ ec, err := ctx.Repo.GetEditorconfig()
+ if err != nil && !git.IsErrNotExist(err) {
+ ctx.Handle(500, "ErrGettingEditorconfig", err)
+ return
+ }
+ ctx.Data["Editorconfig"] = ec
+
ctx.Data["CommitID"] = commitID
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["Username"] = userName
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 8fb7ae1831..77ee4bd348 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -371,6 +371,13 @@ func ViewPullFiles(ctx *context.Context) {
return
}
+ ec, err := ctx.Repo.GetEditorconfig()
+ if err != nil && !git.IsErrNotExist(err) {
+ ctx.Handle(500, "ErrGettingEditorconfig", err)
+ return
+ }
+ ctx.Data["Editorconfig"] = ec
+
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name)
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["Username"] = pull.HeadUserName
@@ -623,6 +630,13 @@ func CompareAndPullRequest(ctx *context.Context) {
}
}
+ ec, err := ctx.Repo.GetEditorconfig()
+ if err != nil && !git.IsErrNotExist(err) {
+ ctx.Handle(500, "ErrGettingEditorconfig", err)
+ return
+ }
+ ctx.Data["Editorconfig"] = ec
+
ctx.HTML(200, COMPARE_PULL)
}
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 9c495b701c..e685597a55 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -225,6 +225,12 @@ func Home(ctx *context.Context) {
ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName
+ ec, err := ctx.Repo.GetEditorconfig()
+ if err != nil && !git.IsErrNotExist(err) {
+ ctx.Handle(500, "ErrGettingEditorconfig", err)
+ return
+ }
+ ctx.Data["Editorconfig"] = ec
var treenames []string
paths := make([]string, 0)