mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Rename repo.GetOwner
to repo.LoadOwner
(#22967)
Fixes https://github.com/go-gitea/gitea/issues/22963 --------- Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
This commit is contained in:
parent
007d181bb5
commit
bd66fa586a
33 changed files with 68 additions and 68 deletions
|
@ -237,7 +237,7 @@ func (repo *Repository) AfterLoad() {
|
|||
// LoadAttributes loads attributes of the repository.
|
||||
func (repo *Repository) LoadAttributes(ctx context.Context) error {
|
||||
// Load owner
|
||||
if err := repo.GetOwner(ctx); err != nil {
|
||||
if err := repo.LoadOwner(ctx); err != nil {
|
||||
return fmt.Errorf("load owner: %w", err)
|
||||
}
|
||||
|
||||
|
@ -373,8 +373,8 @@ func (repo *Repository) GetUnit(ctx context.Context, tp unit.Type) (*RepoUnit, e
|
|||
return nil, ErrUnitTypeNotExist{tp}
|
||||
}
|
||||
|
||||
// GetOwner returns the repository owner
|
||||
func (repo *Repository) GetOwner(ctx context.Context) (err error) {
|
||||
// LoadOwner loads owner user
|
||||
func (repo *Repository) LoadOwner(ctx context.Context) (err error) {
|
||||
if repo.Owner != nil {
|
||||
return nil
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ func (repo *Repository) GetOwner(ctx context.Context) (err error) {
|
|||
// It creates a fake object that contains error details
|
||||
// when error occurs.
|
||||
func (repo *Repository) MustOwner(ctx context.Context) *user_model.User {
|
||||
if err := repo.GetOwner(ctx); err != nil {
|
||||
if err := repo.LoadOwner(ctx); err != nil {
|
||||
return &user_model.User{
|
||||
Name: "error",
|
||||
FullName: err.Error(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue