FIX code review

This commit is contained in:
Jasder
2020-12-07 10:06:08 +08:00
parent 4c980b5774
commit 07caa77f97
3 changed files with 258 additions and 255 deletions
@@ -19,5 +19,13 @@ module ProtectedBranches
def save_protected_branch!
protected_branch.save
end
def save_gitea_protected_branch!
@gitea_protected_branch ||= Gitea::Repository::ProtectedBranches::CreateService.call(@owner.login,
@repository.identifier, gitea_protected_branch_params, @owner.gitea_token)
raise Error, @gitea_protected_branch[:message] unless gitea_protected_branch_saved?(@gitea_protected_branch)
end
end
end