Skip to content

Commit

Permalink
[FIXED JENKINS-26582] To trigger a build from notifyCommit, the proje…
Browse files Browse the repository at this point in the history
…ct must have an SCMTrigger.

This is true even if it has a matching SCM and sha1 is specified.
Otherwise we would be triggering MatrixConfiguration, which is illegal and cause errors.
  • Loading branch information
jglick committed May 13, 2015
1 parent 6c1c49f commit de3117d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/hudson/plugins/git/GitStatus.java
Expand Up @@ -238,8 +238,8 @@ public List<ResponseContributor> onNotifyCommit(URIish uri, String sha1, List<Pa
}

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;
}

Expand All @@ -266,7 +266,7 @@ public List<ResponseContributor> onNotifyCommit(URIish uri, String sha1, List<Pa
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));
Expand Down

0 comments on commit de3117d

Please sign in to comment.