summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-22 11:59:14 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-22 11:59:14 -0400
commite3f55ca0fb0c8aee84f2935b76353ef8ce66384f (patch)
tree1fe38841e4a8a6dc63fc7700d8933b8730c63690 /routers
parentcd070b56d2f5b34236174ff04ccc459d15c4cd17 (diff)
downloadgitea-e3f55ca0fb0c8aee84f2935b76353ef8ce66384f.tar.gz
gitea-e3f55ca0fb0c8aee84f2935b76353ef8ce66384f.zip
Need a field to specify if repository is bare
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/single.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index 37c0fabd79..5906e64fb9 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -69,7 +69,7 @@ func Single(ctx *middleware.Context, params martini.Params) {
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
@@ -224,13 +224,7 @@ func Setting(ctx *middleware.Context, params martini.Params) {
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