Skip to content

Commit 05d27ed

Browse files
committed
Fix merge bug
1 parent d7f78bf commit 05d27ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

models/issues/pull_list.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ func CanUserWriteToBranch(ctx context.Context, p access_model.Permission, headRe
6969
return true
7070
}
7171

72-
return canMaintainerWriteToHeadBranch(ctx, headRepoID, branch, user)
72+
return CanMaintainerWriteToHeadBranch(ctx, headRepoID, branch, user)
7373
}
7474

75-
// canMaintainerWriteToHeadBranch check whether user is a maintainer and could write to the branch
76-
func canMaintainerWriteToHeadBranch(ctx context.Context, headRepoID int64, branch string, user *user_model.User) bool {
75+
// CanMaintainerWriteToHeadBranch check whether user is a maintainer and could write to the branch
76+
func CanMaintainerWriteToHeadBranch(ctx context.Context, headRepoID int64, branch string, user *user_model.User) bool {
7777
prs, err := GetUnmergedPullRequestsByHeadInfo(ctx, headRepoID, branch)
7878
if err != nil {
7979
log.Error("GetUnmergedPullRequestsByHeadInfo: %v", err)

services/context/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ func GitHookService() func(ctx *Context) {
10271027
// canWriteAsMaintainer check if the doer can write to a branch as a maintainer
10281028
func canWriteAsMaintainer(ctx *Context) bool {
10291029
branchName := getRefNameFromPath(ctx.Repo, ctx.PathParam("*"), func(branchName string) bool {
1030-
return issues_model.CanMaintainerWriteToBranch(ctx, ctx.Repo.Permission, branchName, ctx.Doer)
1030+
return issues_model.CanMaintainerWriteToHeadBranch(ctx, ctx.Repo.Repository.ID, branchName, ctx.Doer)
10311031
})
10321032
return len(branchName) > 0
10331033
}

0 commit comments

Comments
 (0)