Skip to content
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

Refactor Branch struct in package modules/git #33980

Merged
merged 22 commits into from
Apr 2, 2025

Conversation

lunny
Copy link
Member

@lunny lunny commented Mar 23, 2025

The Branch struct in modules/git package is unnecessary. We can just use a string to represent a branch

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Mar 23, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 23, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 23, 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 labels Mar 23, 2025
@lunny lunny changed the title Remove repo field in branch struct of git module Refactor Branch struct in package modules/git Mar 23, 2025
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 23, 2025
@@ -169,13 +169,6 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u
}

if pr.Flow == issues_model.PullRequestFlowAGit {
gitRepo, err := gitrepo.OpenRepository(ctx, pr.BaseRepo)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 146 has created gitRepo.

@lunny lunny force-pushed the lunny/remove_unnecessary_repo_branch branch from d537b13 to c46d935 Compare March 23, 2025 00:51
@lunny lunny force-pushed the lunny/remove_unnecessary_repo_branch branch from c352d62 to e5f8538 Compare March 28, 2025 19:32
@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 Apr 1, 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 Apr 2, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 2, 2025
@lunny lunny enabled auto-merge (squash) April 2, 2025 17:03
@lunny lunny merged commit c27d87a into go-gitea:main Apr 2, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Apr 2, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 2, 2025
@lunny lunny deleted the lunny/remove_unnecessary_repo_branch branch April 2, 2025 17:37
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 3, 2025
* giteaofficial/main:
  Refactor Branch struct in package modules/git (go-gitea#33980)
  Support creating relative link to raw path in markdown (go-gitea#34105)
  Add new CLI flags to set name and scopes when creating a user with access token (go-gitea#34080)
  Do not show 500 error when default branch doesn't exist (go-gitea#34096)
  Return default avatar url when user id is zero rather than updating database (go-gitea#34094)
  [skip ci] Updated translations via Crowdin
  Fix return bug (go-gitea#34093)
  Move ParseCommitWithSSHSignature to service layer (go-gitea#34087)
  fix(i18n): clarify ownership in password change error messages (go-gitea#34092)
  Enable addtional linters (go-gitea#34085)
  Add flat-square action badge style (go-gitea#34062)
  Fix some UI bugs and clean up unused tests (go-gitea#34088)
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/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants