diff options
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r-- | modules/middleware/repo.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 3acd7bc842..1d1723445d 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -350,22 +350,25 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { ctx.Data["GoGetImport"] = fmt.Sprintf("%s/%s/%s", setting.Domain, u.Name, repo.Name) } + if ctx.IsSigned { + ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.Id, repo.ID) + ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.Id, repo.ID) + } + // repo is bare and display enable if ctx.Repo.Repository.IsBare { log.Debug("Bare repository: %s", ctx.Repo.RepoLink) // NOTE: to prevent templating error ctx.Data["BranchName"] = "" if displayBare { + if !ctx.Repo.IsAdmin() { + ctx.Flash.Info(ctx.Tr("repo.repo_is_empty"), true) + } ctx.HTML(200, "repo/bare") } return } - if ctx.IsSigned { - ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.Id, repo.ID) - ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.Id, repo.ID) - } - ctx.Data["TagName"] = ctx.Repo.TagName brs, err := ctx.Repo.GitRepo.GetBranches() if err != nil { |