Commit 6e31e1b8 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Resolve app/services/ci/create_pipeline_service.rb

parent 168cb81c
...@@ -16,11 +16,7 @@ module Ci ...@@ -16,11 +16,7 @@ module Ci
protected: project.protected_for?(ref) protected: project.protected_for?(ref)
) )
<<<<<<< HEAD
result = validate_project_and_git_items(mirror_update: mirror_update) || result = validate_project_and_git_items(mirror_update: mirror_update) ||
=======
result = validate_project_and_git_items ||
>>>>>>> upstream/master
validate_pipeline(ignore_skip_ci: ignore_skip_ci, validate_pipeline(ignore_skip_ci: ignore_skip_ci,
save_on_errors: save_on_errors) save_on_errors: save_on_errors)
...@@ -51,22 +47,15 @@ module Ci ...@@ -51,22 +47,15 @@ module Ci
private private
<<<<<<< HEAD
def validate_project_and_git_items(mirror_update: false) def validate_project_and_git_items(mirror_update: false)
=======
def validate_project_and_git_items
>>>>>>> upstream/master
unless project.builds_enabled? unless project.builds_enabled?
return error('Pipeline is disabled') return error('Pipeline is disabled')
end end
<<<<<<< HEAD
if mirror_update && !project.mirror_trigger_builds? if mirror_update && !project.mirror_trigger_builds?
return error('Pipeline is disabled for mirror updates') return error('Pipeline is disabled for mirror updates')
end end
=======
>>>>>>> upstream/master
unless allowed_to_trigger_pipeline? unless allowed_to_trigger_pipeline?
if can?(current_user, :create_pipeline, project) if can?(current_user, :create_pipeline, project)
return error("Insufficient permissions for protected ref '#{ref}'") return error("Insufficient permissions for protected ref '#{ref}'")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment