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 /modules/context | |
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 'modules/context')
-rw-r--r-- | modules/context/api.go | 2 | ||||
-rw-r--r-- | modules/context/repo.go | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/context/api.go b/modules/context/api.go index 6a9c792370..b27ffcbc8c 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -124,7 +124,7 @@ func APIContexter() macaron.Handler { func ReferencesGitRepo() macaron.Handler { return func(ctx *APIContext) { // Empty repository does not have reference information. - if ctx.Repo.Repository.IsBare { + if ctx.Repo.Repository.IsEmpty { return } diff --git a/modules/context/repo.go b/modules/context/repo.go index 55d607a28a..c10abdcb7b 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -234,7 +234,7 @@ func repoAssignment(ctx *Context, repo *models.Repository) { ctx.Repo.Repository = repo ctx.Data["RepoName"] = ctx.Repo.Repository.Name - ctx.Data["IsBareRepo"] = ctx.Repo.Repository.IsBare + ctx.Data["IsEmptyRepo"] = ctx.Repo.Repository.IsEmpty } // RepoIDAssignment returns a macaron handler which assigns the repo to the context. @@ -370,8 +370,8 @@ func RepoAssignment() macaron.Handler { ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.ID, repo.ID) } - // repo is bare and display enable - if ctx.Repo.Repository.IsBare { + // repo is empty and display enable + if ctx.Repo.Repository.IsEmpty { ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch return } @@ -520,7 +520,7 @@ func getRefName(ctx *Context, pathType RepoRefType) string { func RepoRefByType(refType RepoRefType) macaron.Handler { return func(ctx *Context) { // Empty repository does not have reference information. - if ctx.Repo.Repository.IsBare { + if ctx.Repo.Repository.IsEmpty { return } @@ -549,7 +549,7 @@ func RepoRefByType(refType RepoRefType) macaron.Handler { ctx.ServerError("GetBranches", err) return } else if len(brs) == 0 { - err = fmt.Errorf("No branches in non-bare repository %s", + err = fmt.Errorf("No branches in non-empty repository %s", ctx.Repo.GitRepo.Path) ctx.ServerError("GetBranches", err) return |