Don't create self-references in merged PRs#36490
Merged
silverwind merged 12 commits intogo-gitea:mainfrom Jan 30, 2026
Merged
Conversation
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
- Revert template changes - Add check in UpdateIssuesCommit to skip creating CommitRef comments when the commit is the merge commit of the PR it references - This keeps template code unchanged as requested Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
- Add nil check for PullRequest to prevent potential panic - Add comprehensive test case TestUpdateIssuesCommit_SelfReference - Test verifies self-references are skipped while other references work - All tests passing Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
- Use IsErrPullRequestNotExist for proper error handling - Remove redundant nil check (guaranteed after successful load) - Fix test to use different commit SHAs (realistic Git scenario) - All tests still passing Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Use realistic merge message format: "Merge pull request 'title' (#number) from branch into target" Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Cleaned up redundant inline comments while keeping essential test-level documentation Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
wxiaoguang
reviewed
Jan 30, 2026
Extract isSelfReference function to improve code organization and reusability Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Member
Author
a1012112796
approved these changes
Jan 30, 2026
lunny
approved these changes
Jan 30, 2026
silverwind
added a commit
to silverwind/gitea
that referenced
this pull request
Feb 1, 2026
* origin/main: Fix incorrect vendored detections (go-gitea#36508) Bump alpine to 3.23, add platforms to `docker-dryrun` (go-gitea#36379) Unify repo names in system notices (go-gitea#36491) Allow scroll propagation outside code editor (go-gitea#36502) Refactor ActionsTaskID (go-gitea#36503) Update JS deps, remove `knip`, misc tweaks (go-gitea#36499) [skip ci] Updated translations via Crowdin Fix editorconfig not respected in PR Conversation view (go-gitea#36492) Add FOLDER_ICON_THEME configuration option (go-gitea#36496) Don't create self-references in merged PRs (go-gitea#36490) Use reserved .test TLD for unit tests (go-gitea#36498) Fix bug when list pull request commits (go-gitea#36485) Update some go dependencies (go-gitea#36489) chore: add comments for "api/healthz", clean up test env (go-gitea#36481)
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Feb 2, 2026
* giteaofficial/main: (26 commits) [skip ci] Updated translations via Crowdin Remove and forbid `@ts-expect-error` (go-gitea#36513) Add resolve/unresolve review comment API endpoints (go-gitea#36441) Fix incorrect vendored detections (go-gitea#36508) Bump alpine to 3.23, add platforms to `docker-dryrun` (go-gitea#36379) Unify repo names in system notices (go-gitea#36491) Allow scroll propagation outside code editor (go-gitea#36502) Refactor ActionsTaskID (go-gitea#36503) Update JS deps, remove `knip`, misc tweaks (go-gitea#36499) [skip ci] Updated translations via Crowdin Fix editorconfig not respected in PR Conversation view (go-gitea#36492) Add FOLDER_ICON_THEME configuration option (go-gitea#36496) Don't create self-references in merged PRs (go-gitea#36490) Use reserved .test TLD for unit tests (go-gitea#36498) Fix bug when list pull request commits (go-gitea#36485) Update some go dependencies (go-gitea#36489) chore: add comments for "api/healthz", clean up test env (go-gitea#36481) [SECURITY] Toolchain Update to Go 1.25.6 (go-gitea#36480) [skip ci] Updated translations via Crowdin Render merged pull request title as such in dashboard feed (go-gitea#36479) ...
silverwind
added a commit
to silverwind/gitea
that referenced
this pull request
Feb 4, 2026
* origin/main: (1246 commits) fix(packages/container): data race when uploading container blobs concurrently (go-gitea#36524) [skip ci] Updated translations via Crowdin Remove and forbid `@ts-expect-error` (go-gitea#36513) Add resolve/unresolve review comment API endpoints (go-gitea#36441) Fix incorrect vendored detections (go-gitea#36508) Bump alpine to 3.23, add platforms to `docker-dryrun` (go-gitea#36379) Unify repo names in system notices (go-gitea#36491) Allow scroll propagation outside code editor (go-gitea#36502) Refactor ActionsTaskID (go-gitea#36503) Update JS deps, remove `knip`, misc tweaks (go-gitea#36499) [skip ci] Updated translations via Crowdin Fix editorconfig not respected in PR Conversation view (go-gitea#36492) Add FOLDER_ICON_THEME configuration option (go-gitea#36496) Don't create self-references in merged PRs (go-gitea#36490) Use reserved .test TLD for unit tests (go-gitea#36498) Fix bug when list pull request commits (go-gitea#36485) Update some go dependencies (go-gitea#36489) chore: add comments for "api/healthz", clean up test env (go-gitea#36481) [SECURITY] Toolchain Update to Go 1.25.6 (go-gitea#36480) [skip ci] Updated translations via Crowdin ... # Conflicts: # modules/templates/helper.go # options/locale/locale_en-US.ini # routers/web/repo/cherry_pick.go # routers/web/repo/editor.go # routers/web/repo/patch.go # templates/repo/editor/edit.tmpl # web_src/js/features/codeeditor.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes: #36488
Before, useless self-reference:
After, clean:
Originally authored by Copilot in silverwind#5. I will verify the change manually.