Skip to content

Do not mutate incoming options to SearchRepositoryByName #34553

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

Merged
merged 4 commits into from
Jun 2, 2025

Conversation

philip-peterson
Copy link
Contributor

Similar to #34544, this PR changes the opts argument in SearchRepositoryByName() to be passed by value instead of by pointer, as its mutations do not escape the function scope and are not used elsewhere. This simplifies reasoning about the function and avoids unnecessary pointer usage.

This insight emerged during an initial attempt to refactor RenderUserSearch(), which currently intermixes multiple concerns.

Issue targeted: none

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 28, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin labels May 28, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 28, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 2, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 2, 2025
@lunny lunny enabled auto-merge (squash) June 2, 2025 17:06
@lunny lunny added this to the 1.25.0 milestone Jun 2, 2025
@lunny lunny merged commit c5e78fc into go-gitea:main Jun 2, 2025
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 2, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 3, 2025
* giteaofficial/main:
  Refactor some tests (go-gitea#34580)
  Do not mutate incoming options to SearchRepositoryByName (go-gitea#34553)
  Fix/improve avatar sync from LDAP (go-gitea#34573)
  Fix some trivial problems (go-gitea#34579)
  Retain issue sort type when a keyword search is introduced (go-gitea#34559)
  Always use an empty line to separate the commit message and trailer (go-gitea#34512)
  Fix line-button issue after file selection in file tree (go-gitea#34574)
  [skip ci] Updated translations via Crowdin
  Fix doctor deleting orphaned issues attachments (go-gitea#34142)
  [skip ci] Updated translations via Crowdin
  Fix actions skipped commit status indicator (go-gitea#34507)
  Clean up "file-view" related styles (go-gitea#34558)
  Add "View workflow file" to Actions list page (go-gitea#34538)
  Do not mutate incoming options to RenderUserSearch and SearchUsers  (go-gitea#34544)
  Add webhook assigning test and fix possible bug (go-gitea#34420)
  Fix possible nil description of pull request when migrating from CodeCommit (go-gitea#34541)
  Refactor commit reader (go-gitea#34542)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants