Browse Source

fix wrong system notice when repository is empty (#9010)

tags/v1.11.0-rc1
Lunny Xiao zeripath 5 years ago
parent
commit
51155a59e7
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      routers/repo/middlewares.go

+ 5
- 0
routers/repo/middlewares.go View File

@@ -10,6 +10,11 @@ import (

// SetEditorconfigIfExists set editor config as render variable
func SetEditorconfigIfExists(ctx *context.Context) {
if ctx.Repo.Repository.IsEmpty {
ctx.Data["Editorconfig"] = nil
return
}

ec, err := ctx.Repo.GetEditorconfig()

if err != nil && !git.IsErrNotExist(err) {


Loading…
Cancel
Save