Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-06-07 16:14:36 +0300
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-06-07 18:34:59 +0300
commit431d7972b6d0f492bd82004b80d426f2e2cff6a5 (patch)
tree67897bb010b216c02dd1ff96b27b34c5e92f9926
parent1736a2dab6bcab8bb5632e211525bd806bef003a (diff)
Fix unmatches_path
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index a58af73debb..738ff474596 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -208,15 +208,15 @@ module Ci
def matching?(patterns, ref, tag, source)
patterns.any? do |pattern|
pattern, path = pattern.split('@', 2)
- match_path?(path) && match_pattern?(pattern, ref, tag, source)
+ unmatches_path?(path) && matches_pattern?(pattern, ref, tag, source)
end
end
- def match_path?(path)
- return !(path && path != self.path)
+ def unmatches_path?(path)
+ path && path != self.path
end
- def match_pattern?(pattern, ref, tag, source)
+ def matches_pattern?(pattern, ref, tag, source)
return true if tag && pattern == 'tags'
return true if !tag && pattern == 'branches'
return true if source_to_pattern(source) == pattern
@@ -229,8 +229,11 @@ module Ci
end
def source_to_pattern(source)
- return source if %w(api external web).include?(source) || source.nil?
- return source.pluralize
+ if %w(api external web).include?(source) || source.nil?
+ source
+ else
+ source.pluralize
+ end
end
end
end