diff options
Diffstat (limited to 'app/services/commits')
-rw-r--r-- | app/services/commits/change_service.rb | 4 | ||||
-rw-r--r-- | app/services/commits/create_service.rb | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/services/commits/change_service.rb b/app/services/commits/change_service.rb index 661e654406e..edb9f04ccd7 100644 --- a/app/services/commits/change_service.rb +++ b/app/services/commits/change_service.rb @@ -22,7 +22,9 @@ module Commits @branch_name, message, start_project: @start_project, - start_branch_name: @start_branch) + start_branch_name: @start_branch, + dry_run: @dry_run + ) rescue Gitlab::Git::Repository::CreateTreeError => ex act = action.to_s.dasherize type = @commit.change_type_title(current_user) diff --git a/app/services/commits/create_service.rb b/app/services/commits/create_service.rb index d80d9bebe9c..a1498da302e 100644 --- a/app/services/commits/create_service.rb +++ b/app/services/commits/create_service.rb @@ -21,6 +21,7 @@ module Commits @start_sha = params[:start_sha] @branch_name = params[:branch_name] @force = params[:force] || false + @dry_run = params[:dry_run] || false end def execute @@ -69,7 +70,7 @@ module Commits end def validate_permissions! - allowed = ::Gitlab::UserAccess.new(current_user, project: project).can_push_to_branch?(@branch_name) + allowed = ::Gitlab::UserAccess.new(current_user, container: project).can_push_to_branch?(@branch_name) unless allowed raise_error("You are not allowed to push into this branch") |