-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix poster is not loaded in get default merge message #27657
Fix poster is not loaded in get default merge message #27657
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not load attributes in pr.LoadIssue
and then remove all such pr.Issue.Loadxxx?
@@ -356,10 +356,10 @@ func (pr *PullRequest) LoadIssue(ctx context.Context) (err error) {
}
pr.Issue, err = GetIssueByID(ctx, pr.IssueID)
- if err == nil {
- pr.Issue.PullRequest = pr
+ if err != nil {
+ return err
}
- return err
+ return pr.Issue.LoadAttributes(ctx)
}
You don't know whether they need to load all attributes. This will increase memory usage. |
Just a suggestion to make the code look cleaner. If memory usage is the concern, then this PR is LGTM. |
I was unable to create a backport for 1.20. @lunny, please send one manually. 🍵
|
I was unable to create a backport for 1.21. @lunny, please send one manually. 🍵
|
* giteaofficial/main: Improve the list header in milestone page (go-gitea#27302) Fix poster is not loaded in get default merge message (go-gitea#27657) Hide archived labels by default from the suggestions when assigning labels for an issue (go-gitea#27451) actions/setup-go use go-version-file (go-gitea#27651) Update agit-support.en-us.md (go-gitea#27652)
No description provided.