aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2023-02-09 18:08:42 +0100
committerGitHub <noreply@github.com>2023-02-09 12:08:42 -0500
commitbdd2c9d2eff76fed2cc200377723f519e8af64d0 (patch)
tree92a22fcbbed1cb28893a84391dd4239e17d81a9f /services
parent137fcc989bbde6dcddbbf53650e174c119d38068 (diff)
downloadgitea-bdd2c9d2eff76fed2cc200377723f519e8af64d0.tar.gz
gitea-bdd2c9d2eff76fed2cc200377723f519e8af64d0.zip
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.
Diffstat (limited to 'services')
-rw-r--r--services/pull/update.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/pull/update.go b/services/pull/update.go
index ede89bcdff..b9525cf0c9 100644
--- a/services/pull/update.go
+++ b/services/pull/update.go
@@ -106,7 +106,7 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
BaseBranch: pull.HeadBranch,
}
- pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pull.BaseRepoID, pull.BaseBranch)
+ pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pr.BaseRepoID, pr.BaseBranch)
if err != nil {
return false, false, err
}