1
0
mirror of https://github.com/go-gitea/gitea synced 2024-11-10 17:25:54 +01:00

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

This commit is contained in:
Lunny Xiao 2019-11-15 20:13:58 +08:00 committed by GitHub
parent 3487fb66a1
commit fd461ca555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {