Skip to content

Commit c0c2624

Browse files
lunnyzeripath
authored andcommitted
fix wrong system notice when repository is empty (#9010)
1 parent 21ae983 commit c0c2624

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

routers/repo/middlewares.go

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import (
1010

1111
// SetEditorconfigIfExists set editor config as render variable
1212
func SetEditorconfigIfExists(ctx *context.Context) {
13+
if ctx.Repo.Repository.IsEmpty {
14+
ctx.Data["Editorconfig"] = nil
15+
return
16+
}
17+
1318
ec, err := ctx.Repo.GetEditorconfig()
1419

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

0 commit comments

Comments
 (0)