Skip to content

Commit

Permalink
fix canWriteAsMaintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Zettat123 committed Oct 9, 2024
1 parent bcb7884 commit 0e83e04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,8 @@ func GitHookService() func(ctx *Context) {

// canWriteAsMaintainer check if the doer can write to a branch as a maintainer
func canWriteAsMaintainer(ctx *Context) bool {
// There is no need to check if the branch exists.
// If the branch does not exist, CanMaintainerWriteToBranch will return false.
branchName := getRefNameFromPath(ctx.Repo, ctx.PathParam("*"), func(_ string) bool { return true })
return issues_model.CanMaintainerWriteToBranch(ctx, ctx.Repo.Permission, branchName, ctx.Doer)
branchName := getRefNameFromPath(ctx.Repo, ctx.PathParam("*"), func(branchName string) bool {
return issues_model.CanMaintainerWriteToBranch(ctx, ctx.Repo.Permission, branchName, ctx.Doer)
})
return len(branchName) > 0
}

0 comments on commit 0e83e04

Please sign in to comment.