diff options
author | yp05327 <576951401@qq.com> | 2023-02-18 21:11:03 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-18 20:11:03 +0800 |
commit | bd66fa586a0da58c4cf2f5f8390aef4bac9d0527 (patch) | |
tree | 0aa52def7fb8c81ca91a2b882261e9db6a7c174a /routers | |
parent | 007d181bb51330c4c24e78c2f40a2e49cae45ed9 (diff) | |
download | gitea-bd66fa586a0da58c4cf2f5f8390aef4bac9d0527.tar.gz gitea-bd66fa586a0da58c4cf2f5f8390aef4bac9d0527.zip |
Rename `repo.GetOwner` to `repo.LoadOwner` (#22967)
Fixes https://github.com/go-gitea/gitea/issues/22963
---------
Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/repo.go | 2 | ||||
-rw-r--r-- | routers/api/v1/user/repo.go | 4 | ||||
-rw-r--r-- | routers/web/repo/compare.go | 2 | ||||
-rw-r--r-- | routers/web/repo/http.go | 4 | ||||
-rw-r--r-- | routers/web/repo/issue.go | 4 | ||||
-rw-r--r-- | routers/web/repo/pull.go | 8 | ||||
-rw-r--r-- | routers/web/repo/setting.go | 2 | ||||
-rw-r--r-- | routers/web/repo/view.go | 4 |
8 files changed, 15 insertions, 15 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index f5db45ffea..0395198e20 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -201,7 +201,7 @@ func Search(ctx *context.APIContext) { results := make([]*api.Repository, len(repos)) for i, repo := range repos { - if err = repo.GetOwner(ctx); err != nil { + if err = repo.LoadOwner(ctx); err != nil { ctx.JSON(http.StatusInternalServerError, api.SearchError{ OK: false, Error: err.Error(), diff --git a/routers/api/v1/user/repo.go b/routers/api/v1/user/repo.go index d566c072fb..dcb14780a7 100644 --- a/routers/api/v1/user/repo.go +++ b/routers/api/v1/user/repo.go @@ -119,8 +119,8 @@ func ListMyRepos(ctx *context.APIContext) { results := make([]*api.Repository, len(repos)) for i, repo := range repos { - if err = repo.GetOwner(ctx); err != nil { - ctx.Error(http.StatusInternalServerError, "GetOwner", err) + if err = repo.LoadOwner(ctx); err != nil { + ctx.Error(http.StatusInternalServerError, "LoadOwner", err) return } accessMode, err := access_model.AccessLevel(ctx, ctx.Doer, repo) diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 5b6faf4d83..4e40867de2 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -279,7 +279,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo { } return nil } - if err := ci.HeadRepo.GetOwner(ctx); err != nil { + if err := ci.HeadRepo.LoadOwner(ctx); err != nil { if user_model.IsErrUserNotExist(err) { ctx.NotFound("GetUserByName", nil) } else { diff --git a/routers/web/repo/http.go b/routers/web/repo/http.go index e82b94b9e8..9d4ffccc6d 100644 --- a/routers/web/repo/http.go +++ b/routers/web/repo/http.go @@ -146,8 +146,8 @@ func httpBase(ctx *context.Context) (h *serviceHandler) { // don't allow anonymous pulls if organization is not public if isPublicPull { - if err := repo.GetOwner(ctx); err != nil { - ctx.ServerError("GetOwner", err) + if err := repo.LoadOwner(ctx); err != nil { + ctx.ServerError("LoadOwner", err) return } diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 42dcfb382d..62565af50f 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -2157,8 +2157,8 @@ func UpdatePullReviewRequest(ctx *context.Context) { } if reviewID < 0 { // negative reviewIDs represent team requests - if err := issue.Repo.GetOwner(ctx); err != nil { - ctx.ServerError("issue.Repo.GetOwner", err) + if err := issue.Repo.LoadOwner(ctx); err != nil { + ctx.ServerError("issue.Repo.LoadOwner", err) return } diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index ad17005d90..c7a59da8a8 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -119,8 +119,8 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository { return nil } - if err := forkRepo.GetOwner(ctx); err != nil { - ctx.ServerError("GetOwner", err) + if err := forkRepo.LoadOwner(ctx); err != nil { + ctx.ServerError("LoadOwner", err) return nil } @@ -1315,8 +1315,8 @@ func CleanUpPullRequest(ctx *context.Context) { } else if err = pr.LoadBaseRepo(ctx); err != nil { ctx.ServerError("LoadBaseRepo", err) return - } else if err = pr.HeadRepo.GetOwner(ctx); err != nil { - ctx.ServerError("HeadRepo.GetOwner", err) + } else if err = pr.HeadRepo.LoadOwner(ctx); err != nil { + ctx.ServerError("HeadRepo.LoadOwner", err) return } diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index 436438c436..387a917412 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -650,7 +650,7 @@ func SettingsPost(ctx *context.Context) { ctx.Error(http.StatusNotFound) return } - if err := repo.GetOwner(ctx); err != nil { + if err := repo.LoadOwner(ctx); err != nil { ctx.ServerError("Convert Fork", err) return } diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 99043e3ee7..e3c61fa408 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -1033,8 +1033,8 @@ func Forks(ctx *context.Context) { } for _, fork := range forks { - if err = fork.GetOwner(ctx); err != nil { - ctx.ServerError("GetOwner", err) + if err = fork.LoadOwner(ctx); err != nil { + ctx.ServerError("LoadOwner", err) return } } |