diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-22 11:59:14 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-22 11:59:14 -0400 |
commit | e3f55ca0fb0c8aee84f2935b76353ef8ce66384f (patch) | |
tree | 1fe38841e4a8a6dc63fc7700d8933b8730c63690 /routers | |
parent | cd070b56d2f5b34236174ff04ccc459d15c4cd17 (diff) | |
download | gitea-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.go | 10 |
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 |