Skip to content

Conversation

@lunny
Copy link
Member

@lunny lunny commented Nov 14, 2025

Resolve #35368

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 14, 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 Nov 14, 2025
@lunny lunny force-pushed the lunny/support_update_branch_api branch from 5ed2141 to 2ad3451 Compare November 14, 2025 03:22
@lunny lunny marked this pull request as ready for review November 18, 2025 17:58
@lunny lunny added this to the 1.26.0 milestone Nov 18, 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 Nov 18, 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 Nov 26, 2025
Comment on lines +550 to +557
pushEnv := repo_module.PushingEnvironment(doer, repo)

protectedBranch, err := git_model.GetFirstMatchProtectedBranchRule(ctx, repo.ID, branchName)
if err != nil {
return fmt.Errorf("GetFirstMatchProtectedBranchRule: %w", err)
}
if protectedBranch != nil {
protectedBranch.Repo = repo
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the code copied from? I believe it's not the first time to duplicate such "protection" check.

@wxiaoguang wxiaoguang marked this pull request as draft November 28, 2025 01:36
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API to update (reset) a branch

5 participants