Merge pull request #514 from czoellin/master

Fix branch name comparison to avoid spurious builds
This commit is contained in:
Owen Mehegan 2017-08-30 15:22:03 -07:00 committed by GitHub
commit 03477fa591
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class OpenMergeRequestPushHookTriggerHandler implements PushHookTriggerHandler {
String targetBranch = mergeRequest.getTargetBranch();
String sourceBranch = mergeRequest.getSourceBranch();
if (targetBranch != null && branchFilter.isBranchAllowed(targetBranch) && hook.getRef().endsWith(targetBranch) && sourceBranch != null) {
if (targetBranch != null && branchFilter.isBranchAllowed(targetBranch) && hook.getRef().equals("refs/heads/"+targetBranch) && sourceBranch != null) {
LOGGER.log(Level.INFO, "{0} triggered for push to target branch of open merge request #{1}.",
LoggerUtil.toArray(job.getFullName(), mergeRequest.getId()));