Name string `xorm:"index not null"`
Description string
Website string
- Private bool
NumWatches int
NumStars int
NumForks int
+ IsPrivate bool
+ IsBare bool
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
}
Name: repoName,
LowerName: strings.ToLower(repoName),
Description: desc,
- Private: private,
+ IsPrivate: private,
+ IsBare: repoLang == "" && license == "" && !initReadme,
}
repoPath := RepoPath(user.Name, repoName)
log.Error("repo.Single(GetBranches): %v", err)
ctx.Error(404)
return
- } else if len(brs) == 0 {
+ } else if ctx.Repo.Repository.IsBare {
ctx.Data["IsBareRepo"] = true
ctx.HTML(200, "repo/single")
return
ctx.Data["IsRepoToolbarSetting"] = true
- // Branches.
- brs, err := models.GetBranches(params["username"], params["reponame"])
- if err != nil {
- log.Error("repo.Setting(GetBranches): %v", err)
- ctx.Error(404)
- return
- } else if len(brs) == 0 {
+ if ctx.Repo.Repository.IsBare {
ctx.Data["IsBareRepo"] = true
ctx.HTML(200, "repo/setting")
return