summaryrefslogtreecommitdiff
path: root/app/services/protected_branches/api_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/protected_branches/api_service.rb')
-rw-r--r--app/services/protected_branches/api_service.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/services/protected_branches/api_service.rb b/app/services/protected_branches/api_service.rb
index ac4917d6590..bf1a966472b 100644
--- a/app/services/protected_branches/api_service.rb
+++ b/app/services/protected_branches/api_service.rb
@@ -9,10 +9,15 @@ module ProtectedBranches
def protected_branch_params
{
name: params[:name],
+ allow_force_push: allow_force_push?,
push_access_levels_attributes: AccessLevelParams.new(:push, params).access_levels,
merge_access_levels_attributes: AccessLevelParams.new(:merge, params).access_levels
}
end
+
+ def allow_force_push?
+ params[:allow_force_push] || false
+ end
end
end