瀏覽代碼

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

tags/v1.11.0-rc1
Lunny Xiao 4 年之前
父節點
當前提交
c0c2624079
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5
    0
      routers/repo/middlewares.go

+ 5
- 0
routers/repo/middlewares.go 查看文件

@@ -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…
取消
儲存