diff options
author | zeripath <art27@cantab.net> | 2019-01-18 00:01:04 +0000 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2019-01-17 19:01:04 -0500 |
commit | 07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8 (patch) | |
tree | 87ced90635366b09e7e5f2634acfe2cbec2bc9f6 /routers/repo | |
parent | 9edc829c1758b436f8f52ebe61479af087940d60 (diff) | |
download | gitea-07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8.tar.gz gitea-07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8.zip |
Refactor repo.isBare to repo.isEmpty #5629 (#5714)
* Refactor repo.isBare to repo.isEmpty #5629
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove Sync call
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/pull.go | 2 | ||||
-rw-r--r-- | routers/repo/repo.go | 8 | ||||
-rw-r--r-- | routers/repo/view.go | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 36135084aa..688a033fdb 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -63,7 +63,7 @@ func getForkRepository(ctx *context.Context) *models.Repository { return nil } - if forkRepo.IsBare || !perm.CanRead(models.UnitTypeCode) { + if forkRepo.IsEmpty || !perm.CanRead(models.UnitTypeCode) { ctx.NotFound("getForkRepository", nil) return nil } diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 6071b7a54a..960961a5e5 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -28,10 +28,10 @@ const ( tplMigrate base.TplName = "repo/migrate" ) -// MustBeNotBare render when a repo is a bare git dir -func MustBeNotBare(ctx *context.Context) { - if ctx.Repo.Repository.IsBare { - ctx.NotFound("MustBeNotBare", nil) +// MustBeNotEmpty render when a repo is a empty git dir +func MustBeNotEmpty(ctx *context.Context) { + if ctx.Repo.Repository.IsEmpty { + ctx.NotFound("MustBeNotEmpty", nil) } } diff --git a/routers/repo/view.go b/routers/repo/view.go index 8739c139d9..66977e3b5e 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -30,10 +30,10 @@ import ( ) const ( - tplRepoBARE base.TplName = "repo/bare" - tplRepoHome base.TplName = "repo/home" - tplWatchers base.TplName = "repo/watchers" - tplForks base.TplName = "repo/forks" + tplRepoEMPTY base.TplName = "repo/empty" + tplRepoHome base.TplName = "repo/home" + tplWatchers base.TplName = "repo/watchers" + tplForks base.TplName = "repo/forks" ) func renderDirectory(ctx *context.Context, treeLink string) { @@ -321,8 +321,8 @@ func Home(ctx *context.Context) { func renderCode(ctx *context.Context) { ctx.Data["PageIsViewCode"] = true - if ctx.Repo.Repository.IsBare { - ctx.HTML(200, tplRepoBARE) + if ctx.Repo.Repository.IsEmpty { + ctx.HTML(200, tplRepoEMPTY) return } |