Commit 8b34687a authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge conditions. Not worth an additional pointless method:

Feedback from:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4093#note_12321267
parent d7b08024
...@@ -99,9 +99,7 @@ module Ci ...@@ -99,9 +99,7 @@ module Ci
end end
def can_pick?(build) def can_pick?(build)
available_for?(build.project) && available_for?(build.project) && accepting_tags?(build)
run_untagged_or_has_tags?(build) &&
accepting_tags?(build.tag_list)
end end
def only_for?(project) def only_for?(project)
...@@ -129,12 +127,8 @@ module Ci ...@@ -129,12 +127,8 @@ module Ci
!locked? || projects.exists?(id: project.id) !locked? || projects.exists?(id: project.id)
end end
def run_untagged_or_has_tags?(build) def accepting_tags?(build)
run_untagged? || build.has_tags? (run_untagged? || build.has_tags?) && (build.tag_list - tag_list).empty?
end
def accepting_tags?(target_tags)
(target_tags - tag_list).empty?
end end
end end
end end
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