diff options
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r-- | modules/middleware/repo.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 8f44ac9a..1d172344 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -347,7 +347,12 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { ctx.Data["CloneLink"] = ctx.Repo.CloneLink if ctx.Query("go-get") == "1" { - ctx.Data["GoGetImport"] = fmt.Sprintf("%s/%s/%s", setting.Domain, u.LowerName, repo.LowerName) + 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 @@ -356,16 +361,14 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { // 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 { |