aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/pull.go
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2017-02-01 10:21:03 -0200
committer无闻 <u@gogs.io>2017-02-01 07:21:03 -0500
commit1d951cfc4915d9beb12b9e2e9fcd178069e4ce02 (patch)
tree4771d054576b5265e3c137c152d0ba472f933768 /routers/repo/pull.go
parent32a0255ce3641bdad7c654cf9677115b6ef31759 (diff)
Fix 500 when repo has invalid .editorconfig (#3758)
Creating a notice instead Fixes #3643
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r--routers/repo/pull.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index fe606010..d649e3d7 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -357,12 +357,10 @@ func ViewPullFiles(ctx *context.Context) {
return
}
- ec, err := ctx.Repo.GetEditorconfig()
- if err != nil && !git.IsErrNotExist(err) {
- ctx.Handle(500, "ErrGettingEditorconfig", err)
+ setEditorconfigIfExists(ctx)
+ if ctx.Written() {
return
}
- ctx.Data["Editorconfig"] = ec
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name)
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
@@ -616,12 +614,10 @@ func CompareAndPullRequest(ctx *context.Context) {
}
}
- ec, err := ctx.Repo.GetEditorconfig()
- if err != nil && !git.IsErrNotExist(err) {
- ctx.Handle(500, "ErrGettingEditorconfig", err)
+ setEditorconfigIfExists(ctx)
+ if ctx.Written() {
return
}
- ctx.Data["Editorconfig"] = ec
ctx.HTML(200, COMPARE_PULL)
}