-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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: release page for empty or non-existing target #24470
Conversation
I was unable to create a backport for 1.19. @oliverpool, please send one manually. 🍵 |
* upstream/main: Remove unnecessary code (go-gitea#24610) Fix commits pushed with deploy keys not shown in dashboard (go-gitea#24521) fix: release page for empty or non-existing target (go-gitea#24470) Filter get single commit (go-gitea#24613) Attach a tooltip to the action status icon (go-gitea#24614) Use official Vue extension in Gitpod (go-gitea#24609) Create a branch directly from commit on the create branch API (go-gitea#22956) Make repository response support HTTP range request (go-gitea#24592)
Backport go-gitea#24470 Fixes go-gitea#24145 --- To solve the bug, I added a "computed" `TargetBehind` field to the `Release` model, which indicates the target branch of a release. This is particularly useful if the target branch was deleted in the meantime (or is empty). I also did a micro-optimization in `calReleaseNumCommitsBehind`. Instead of checking that a branch exists and then call `GetBranchCommit`, I immediately call `GetBranchCommit` and handle the `git.ErrNotExist` error. This optimization is covered by the added unit test.
Backport created: #24659 It would be even nicer if the
|
Raise issue here: https://github.com/GiteaBot/gitea-backporter/issues |
@silverwind thanks for the hint, I opened an issue (I had no idea where the bot code was located :) |
Backport #24470 Fixes #24145 --- To solve the bug, I added a "computed" `TargetBehind` field to the `Release` model, which indicates the target branch of a release. This is particularly useful if the target branch was deleted in the meantime (or is empty). I also did a micro-optimization in `calReleaseNumCommitsBehind`. Instead of checking that a branch exists and then call `GetBranchCommit`, I immediately call `GetBranchCommit` and handle the `git.ErrNotExist` error. This optimization is covered by the added unit test. _contributed in the context of @forgejo_
Backport go-gitea#24470 Fixes go-gitea#24145 --- To solve the bug, I added a "computed" `TargetBehind` field to the `Release` model, which indicates the target branch of a release. This is particularly useful if the target branch was deleted in the meantime (or is empty). I also did a micro-optimization in `calReleaseNumCommitsBehind`. Instead of checking that a branch exists and then call `GetBranchCommit`, I immediately call `GetBranchCommit` and handle the `git.ErrNotExist` error. This optimization is covered by the added unit test. _contributed in the context of @forgejo_ (cherry picked from commit cb7ba89)
Fixes #24145
To solve the bug, I added a "computed"
TargetBehind
field to theRelease
model, which indicates the target branch of a release.This is particularly useful if the target branch was deleted in the meantime (or is empty).
I also did a micro-optimization in
calReleaseNumCommitsBehind
. Instead of checking that a branch exists and then callGetBranchCommit
, I immediately callGetBranchCommit
and handle thegit.ErrNotExist
error.This optimization is covered by the added unit test.
contributed in the context of @forgejo