mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Backport #20509
This commit is contained in:
		@@ -902,10 +902,14 @@ func renderCode(ctx *context.Context) {
 | 
				
			|||||||
	ctx.Data["PageIsViewCode"] = true
 | 
						ctx.Data["PageIsViewCode"] = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ctx.Repo.Repository.IsEmpty {
 | 
						if ctx.Repo.Repository.IsEmpty {
 | 
				
			||||||
		reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
 | 
							reallyEmpty := true
 | 
				
			||||||
		if err != nil {
 | 
							var err error
 | 
				
			||||||
			ctx.ServerError("GitRepo.IsEmpty", err)
 | 
							if ctx.Repo.GitRepo != nil {
 | 
				
			||||||
			return
 | 
								reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									ctx.ServerError("GitRepo.IsEmpty", err)
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if reallyEmpty {
 | 
							if reallyEmpty {
 | 
				
			||||||
			ctx.HTML(http.StatusOK, tplRepoEMPTY)
 | 
								ctx.HTML(http.StatusOK, tplRepoEMPTY)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user