mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-24 02:59:42 +08:00
parent
eeaa9250e0
commit
9aa13c585e
@ -856,10 +856,14 @@ func renderCode(ctx *context.Context) {
|
||||
ctx.Data["PageIsViewCode"] = true
|
||||
|
||||
if ctx.Repo.Repository.IsEmpty {
|
||||
reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
|
||||
if err != nil {
|
||||
ctx.ServerError("GitRepo.IsEmpty", err)
|
||||
return
|
||||
reallyEmpty := true
|
||||
var err error
|
||||
if ctx.Repo.GitRepo != nil {
|
||||
reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
|
||||
if err != nil {
|
||||
ctx.ServerError("GitRepo.IsEmpty", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
if reallyEmpty {
|
||||
ctx.HTML(http.StatusOK, tplRepoEMPTY)
|
||||
|
Loading…
Reference in New Issue
Block a user