Negate if statement and prevent fall through

This commit is contained in:
Duff, Robert W 2016-03-22 12:08:14 -04:00
parent fe53a772aa
commit fad5cddaf5
1 changed files with 4 additions and 7 deletions

View File

@ -383,14 +383,11 @@ public class GitLabPushTrigger extends Trigger<Job<?, ?>> {
}
scheduledJob.scheduleBuild2(projectbuildDelay, action, new CauseAction(cause));
} else {
if (triggerOnMergeRequest ) {
LOGGER.log(Level.INFO, "trigger on merge request not set");
} else if ( this.isBranchAllowed(req.getObjectAttribute().getTargetBranch())) {
LOGGER.log(Level.INFO, "branch {0} is not allowed", req.getObjectAttribute().getTargetBranch());
}
} else if ( ! triggerOnMergeRequest ) {
LOGGER.log(Level.INFO, "trigger on merge request not set");
} else {
LOGGER.log(Level.INFO, "branch {0} is not allowed", req.getObjectAttribute().getTargetBranch());
}
}