summaryrefslogtreecommitdiff
path: root/zuul/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'zuul/model.py')
-rw-r--r--zuul/model.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/zuul/model.py b/zuul/model.py
index 11fa38395..8fe4d1489 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -961,7 +961,7 @@ class Job(object):
m = m.matchers[0]
if not isinstance(m, change_matcher.BranchMatcher):
return None
- return m._regex
+ return m
def addBranchMatcher(self, branch):
# Add a branch matcher that combines as a boolean *and* with
@@ -1129,9 +1129,10 @@ class JobList(object):
# ensure that it still only affects this branch
# (whatever else it may do).
simple_branch = job.getSimpleBranchMatcher()
- if simple_branch and simple_branch != implied_branch:
- # Job is for a different branch, don't add it.
- continue
+ if simple_branch:
+ if not simple_branch.regex.match(implied_branch):
+ # This branch will never match, don't add it.
+ continue
if not simple_branch:
# The branch matcher could be complex, or
# missing. Add our implied matcher.