diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/convert/issue.go | 2 | ||||
-rw-r--r-- | services/convert/repository.go | 2 | ||||
-rw-r--r-- | services/pull/check.go | 4 | ||||
-rw-r--r-- | services/pull/merge.go | 6 | ||||
-rw-r--r-- | services/pull/temp_repo.go | 12 | ||||
-rw-r--r-- | services/repository/review.go | 2 | ||||
-rw-r--r-- | services/repository/transfer.go | 2 |
7 files changed, 15 insertions, 15 deletions
diff --git a/services/convert/issue.go b/services/convert/issue.go index 02f25e6e0e..dccf2f3727 100644 --- a/services/convert/issue.go +++ b/services/convert/issue.go @@ -32,7 +32,7 @@ func ToAPIIssue(ctx context.Context, issue *issues_model.Issue) *api.Issue { if err := issue.LoadRepo(ctx); err != nil { return &api.Issue{} } - if err := issue.Repo.GetOwner(ctx); err != nil { + if err := issue.Repo.LoadOwner(ctx); err != nil { return &api.Issue{} } diff --git a/services/convert/repository.go b/services/convert/repository.go index 5db68e8379..fc965a9457 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -100,7 +100,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc hasProjects = true } - if err := repo.GetOwner(ctx); err != nil { + if err := repo.LoadOwner(ctx); err != nil { return nil } diff --git a/services/pull/check.go b/services/pull/check.go index ea5cccbdec..310ea2e714 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -261,8 +261,8 @@ func manuallyMerged(ctx context.Context, pr *issues_model.PullRequest) bool { // When the commit author is unknown set the BaseRepo owner as merger if merger == nil { if pr.BaseRepo.Owner == nil { - if err = pr.BaseRepo.GetOwner(ctx); err != nil { - log.Error("%-v BaseRepo.GetOwner: %v", pr, err) + if err = pr.BaseRepo.LoadOwner(ctx); err != nil { + log.Error("%-v BaseRepo.LoadOwner: %v", pr, err) return false } } diff --git a/services/pull/merge.go b/services/pull/merge.go index a3d69df8df..3ac67d91b7 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -199,8 +199,8 @@ func Merge(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.U if err := pr.Issue.LoadRepo(hammerCtx); err != nil { log.Error("LoadRepo for issue [%d]: %v", pr.ID, err) } - if err := pr.Issue.Repo.GetOwner(hammerCtx); err != nil { - log.Error("GetOwner for PR [%d]: %v", pr.ID, err) + if err := pr.Issue.Repo.LoadOwner(hammerCtx); err != nil { + log.Error("LoadOwner for PR [%d]: %v", pr.ID, err) } if wasAutoMerged { @@ -573,7 +573,7 @@ func rawMerge(ctx context.Context, pr *issues_model.PullRequest, doer *user_mode } var headUser *user_model.User - err = pr.HeadRepo.GetOwner(ctx) + err = pr.HeadRepo.LoadOwner(ctx) if err != nil { if !user_model.IsErrUserNotExist(err) { log.Error("Can't find user: %d for head repository - %v", pr.HeadRepo.OwnerID, err) diff --git a/services/pull/temp_repo.go b/services/pull/temp_repo.go index d49a15cea0..e0d6b4a158 100644 --- a/services/pull/temp_repo.go +++ b/services/pull/temp_repo.go @@ -38,12 +38,12 @@ func createTemporaryRepo(ctx context.Context, pr *issues_model.PullRequest) (str return "", &repo_model.ErrRepoNotExist{ ID: pr.BaseRepoID, } - } else if err := pr.HeadRepo.GetOwner(ctx); err != nil { - log.Error("HeadRepo.GetOwner: %v", err) - return "", fmt.Errorf("HeadRepo.GetOwner: %w", err) - } else if err := pr.BaseRepo.GetOwner(ctx); err != nil { - log.Error("BaseRepo.GetOwner: %v", err) - return "", fmt.Errorf("BaseRepo.GetOwner: %w", err) + } else if err := pr.HeadRepo.LoadOwner(ctx); err != nil { + log.Error("HeadRepo.LoadOwner: %v", err) + return "", fmt.Errorf("HeadRepo.LoadOwner: %w", err) + } else if err := pr.BaseRepo.LoadOwner(ctx); err != nil { + log.Error("BaseRepo.LoadOwner: %v", err) + return "", fmt.Errorf("BaseRepo.LoadOwner: %w", err) } // Clone base repo. diff --git a/services/repository/review.go b/services/repository/review.go index d30d61ee06..6b5f096053 100644 --- a/services/repository/review.go +++ b/services/repository/review.go @@ -12,7 +12,7 @@ import ( // GetReviewerTeams get all teams can be requested to review func GetReviewerTeams(repo *repo_model.Repository) ([]*organization.Team, error) { - if err := repo.GetOwner(db.DefaultContext); err != nil { + if err := repo.LoadOwner(db.DefaultContext); err != nil { return nil, err } if !repo.Owner.IsOrganization() { diff --git a/services/repository/transfer.go b/services/repository/transfer.go index f4afb7e2de..8c167552da 100644 --- a/services/repository/transfer.go +++ b/services/repository/transfer.go @@ -26,7 +26,7 @@ var repoWorkingPool = sync.NewExclusivePool() // TransferOwnership transfers all corresponding setting from old user to new one. func TransferOwnership(ctx context.Context, doer, newOwner *user_model.User, repo *repo_model.Repository, teams []*organization.Team) error { - if err := repo.GetOwner(ctx); err != nil { + if err := repo.LoadOwner(ctx); err != nil { return err } for _, team := range teams { |