ADD protected branch Features

This commit is contained in:
Jasder
2020-12-03 15:24:40 +08:00
parent a24f0f8b45
commit 6a8ae5234b
40 changed files with 1252 additions and 11 deletions

View File

@@ -0,0 +1,22 @@
module ProtectedBranches
class CreateService < ProtectedBranches::BaseService
def call
validate!
save_gitea_protected_branch!
save_protected_branch!
protected_branch
end
private
def protected_branch
@protected_branch ||= repository.protected_branches.new(protected_branch_params)
end
def save_protected_branch!
protected_branch.save
end
end
end