Skip to content

Commit bdd2c9d

Browse files
authored
Fix update by rebase being wrongly disabled by protected base branch (#22825)
The branch this is force pushing to is the head branch in the head repo, so it should be checking if that is protected, not the base.
1 parent 137fcc9 commit bdd2c9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: services/pull/update.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
106106
BaseBranch: pull.HeadBranch,
107107
}
108108

109-
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pull.BaseRepoID, pull.BaseBranch)
109+
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pr.BaseRepoID, pr.BaseBranch)
110110
if err != nil {
111111
return false, false, err
112112
}

0 commit comments

Comments
 (0)