mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	fix wrong system notice when repository is empty (#9020)
This commit is contained in:
		@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user