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

Fix incorrect default branch when adopt a repository #30912

Merged
merged 4 commits into from
May 9, 2024

Conversation

yp05327
Copy link
Contributor

@yp05327 yp05327 commented May 9, 2024

Fix #30521

we should sync branches first, then detect default branch, or git_model.FindBranchNames will always return empty list, and the detection will be wrong.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 9, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 9, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label May 9, 2024
@yp05327 yp05327 changed the title Fix incorrect default branche when adopt repository Fix incorrect default branch when adopt a repository May 9, 2024
@yp05327 yp05327 added this to the 1.23.0 milestone May 9, 2024
services/repository/adopt.go Outdated Show resolved Hide resolved
@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 9, 2024
@wxiaoguang wxiaoguang added the backport/v1.22 This PR should be backported to Gitea 1.22 label May 9, 2024
@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 May 9, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 9, 2024
@lunny lunny enabled auto-merge (squash) May 9, 2024 08:18
@lunny lunny merged commit e94723f into go-gitea:main May 9, 2024
26 checks passed
@GiteaBot
Copy link
Contributor

GiteaBot commented May 9, 2024

I was unable to create a backport for 1.22. @yp05327, please send one manually. 🍵

go run ./contrib/backport 30912
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added backport/manual No power to the bots! Create your backport yourself! and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels May 9, 2024
@lunny lunny added the backport/done All backports for this PR have been created label May 10, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 10, 2024
* giteaofficial/main:
  Fix incorrect default branch when adopt a repository (go-gitea#30912)
lunny pushed a commit that referenced this pull request May 10, 2024
Backport #30912

ps: removed useless `u *user_model.User` for `adoptRepository`
@yp05327 yp05327 deleted the fix-30521 branch May 27, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import from gogs /github.
4 participants