diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-12-12 23:48:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-12 23:48:20 +0800 |
commit | 572324049008ac803d3d7c17a7b3a81ef00386fc (patch) | |
tree | a9c3709643a23165d27aa67e76f10f26a89936d5 /modules/context/repo.go | |
parent | 0a7e8327a017c5dd43e552bbcd0d0f056bc1671b (diff) | |
download | gitea-572324049008ac803d3d7c17a7b3a81ef00386fc.tar.gz gitea-572324049008ac803d3d7c17a7b3a81ef00386fc.zip |
Some repository refactors (#17950)
* some repository refactors
* remove unnecessary code
* Fix test
* Remove unnecessary banner
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r-- | modules/context/repo.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 1725cb724d..b54401f348 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -443,10 +443,10 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { repo, err := repo_model.GetRepositoryByName(owner.ID, repoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { - redirectRepoID, err := models.LookupRepoRedirect(owner.ID, repoName) + redirectRepoID, err := repo_model.LookupRedirect(owner.ID, repoName) if err == nil { RedirectToRepo(ctx, redirectRepoID) - } else if models.IsErrRepoRedirectNotExist(err) { + } else if repo_model.IsErrRedirectNotExist(err) { if ctx.FormString("go-get") == "1" { EarlyResponseForGoGetMeta(ctx) return @@ -512,8 +512,8 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { ctx.Data["WikiCloneLink"] = repo.WikiCloneLink() if ctx.IsSigned { - ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.ID, repo.ID) - ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.ID, repo.ID) + ctx.Data["IsWatchingRepo"] = repo_model.IsWatching(ctx.User.ID, repo.ID) + ctx.Data["IsStaringRepo"] = repo_model.IsStaring(ctx.User.ID, repo.ID) } if repo.IsFork { @@ -613,7 +613,7 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { // People who have push access or have forked repository can propose a new pull request. canPush := ctx.Repo.CanWrite(unit_model.TypeCode) || - (ctx.IsSigned && models.HasForkedRepo(ctx.User.ID, ctx.Repo.Repository.ID)) + (ctx.IsSigned && repo_model.HasForkedRepo(ctx.User.ID, ctx.Repo.Repository.ID)) canCompare := false // Pull request is allowed if this is a fork repository |