Skip to content
Permalink
Browse files
Merge pull request #319 from jglick/SCMTrigger-JENKINS-26582
[JENKINS-26582] notifyCommit should ignore projects without SCMTrigger

Passed tests on multiple platforms.
  • Loading branch information
MarkEWaite committed May 14, 2015
2 parents 6c1c49f + a1a9d1f commit b88b388aee1085e5d161c578c3f551953b27abf4
Showing with 6 additions and 3 deletions.
  1. +3 −3 src/main/java/hudson/plugins/git/GitStatus.java
  2. +3 −0 src/test/java/hudson/plugins/git/GitSCMTest.java
@@ -238,8 +238,8 @@ public void writeBody(PrintWriter w) {
}

SCMTrigger trigger = scmTriggerItem.getSCMTrigger();
if (trigger != null && trigger.isIgnorePostCommitHooks()) {
LOGGER.info("PostCommitHooks are disabled on " + project.getFullDisplayName());
if (trigger == null || trigger.isIgnorePostCommitHooks()) {
LOGGER.info("no trigger, or post-commit hooks disabled, on " + project.getFullDisplayName());
continue;
}

@@ -266,7 +266,7 @@ public void writeBody(PrintWriter w) {
new CauseAction(new CommitHookCause(sha1)),
new RevisionParameterAction(sha1), new ParametersAction(buildParameters));
result.add(new ScheduledResponseContributor(project));
} else if (trigger != null) {
} else {
LOGGER.info("Triggering the polling of " + project.getFullDisplayName());
trigger.run();
result.add(new PollingScheduledResponseContributor(project));
@@ -33,6 +33,7 @@
import hudson.slaves.DumbSlave;
import hudson.slaves.EnvironmentVariablesNodeProperty.Entry;
import hudson.tools.ToolProperty;
import hudson.triggers.SCMTrigger;
import hudson.util.IOException2;
import hudson.util.StreamTaskListener;

@@ -1559,6 +1560,7 @@ public void testPolling_environmentValueAsEnvironmentContributingAction() throws
public void testCustomSCMName() throws Exception {
final String branchName = "master";
final FreeStyleProject project = setupProject(branchName, false);
project.addTrigger(new SCMTrigger(""));
GitSCM git = (GitSCM) project.getScm();
setupJGit(git);

@@ -1654,6 +1656,7 @@ private void checkNumberedBuildScmName(FreeStyleProject project, int buildNumber
public void testSha1NotificationBranches() throws Exception {
final String branchName = "master";
final FreeStyleProject project = setupProject(branchName, false);
project.addTrigger(new SCMTrigger(""));
final GitSCM git = (GitSCM) project.getScm();
setupJGit(git);

0 comments on commit b88b388

Please sign in to comment.