-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Reading pull attachments should depend on read UnitTypePullRequests #10346
Reading pull attachments should depend on read UnitTypePullRequests #10346
Conversation
@@ -79,7 +79,11 @@ func (a *Attachment) LinkedRepository() (*Repository, UnitType, error) { | |||
return nil, UnitTypeIssues, err |
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.
Maybe the correct unitType (UnitTypePullRequests instead of UnitTypeIssues) is of interest here, too?!
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.
don't have an issue to be able to check if it is a pull
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.
and in any case if err is not nil then the unitType is not used:
repository, unitType, err := attach.LinkedRepository()
if err != nil {
ctx.ServerError("LinkedRepository", err)
return
}
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.
Oh, of course, you're right.
…github.com:zeripath/gitea into fix-10336-attachments-on-pulls-depend-on-read-pull
Codecov Report
@@ Coverage Diff @@
## master #10346 +/- ##
==========================================
+ Coverage 43.69% 43.72% +0.02%
==========================================
Files 585 585
Lines 81023 81023
==========================================
+ Hits 35407 35424 +17
+ Misses 41227 41212 -15
+ Partials 4389 4387 -2
Continue to review full report at Codecov.
|
…o-gitea#10346) * Make pull attachments depend on read UnitTypePullRequests Fixes go-gitea#10336 * Fix test
Previously these would depend on read UnitTypeIssues.
Fixes #10336