Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[FIXED JENKINS-10880] check for existing lastBuild #65

Merged
merged 1 commit into from

3 participants

marc-guenther BuildHive Kohsuke Kawaguchi
marc-guenther
Collaborator

Fix the NPE when there was no lastBuild available with
fast remote polling enabled

BuildHive

Jenkins » git-plugin #4 FAILURE
Looks like there's a problem with this pull request
(what's this?)

Marc Guenther [FIXED JENKINS-10880] check for existing lastBuild
Fix the NPE when there was no lastBuild available with
fast remote polling enabled
91cc5c9
BuildHive

Jenkins » git-plugin #27 SUCCESS
This pull request looks good
(what's this?)

marc-guenther
Collaborator

just rebased against the current master, contents are the same as before. The failure from 3 months ago had nothing to do with this change.

Kohsuke Kawaguchi kohsuke merged commit 0551fc3 into from
Kohsuke Kawaguchi
Owner

My apologies for the delay in coming back to this.

I've added you as a committer to the repository so that you won't be blocked for changes like this.

BuildHive

Jenkins » git-plugin #31 UNSTABLE
Looks like this commit caused a build failure
(what's this?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 25, 2012
  1. marc-guenther

    [FIXED JENKINS-10880] check for existing lastBuild

    Marc Guenther authored marc-guenther committed
    Fix the NPE when there was no lastBuild available with
    fast remote polling enabled
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/hudson/plugins/git/GitSCM.java
5 src/main/java/hudson/plugins/git/GitSCM.java
View
@@ -662,13 +662,14 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project,
final BuildData buildData = fixNull(getBuildData(lastBuild, false));
- if (buildData != null && buildData.lastBuild != null) {
+ if (buildData.lastBuild != null) {
listener.getLogger().println("[poll] Last Built Revision: " + buildData.lastBuild.revision);
}
final String singleBranch = getSingleBranch(lastBuild);
- if (singleBranch != null && this.remotePoll) {
+ // fast remote polling needs a single branch and an existing last build
+ if (this.remotePoll && singleBranch != null && buildData.lastBuild != null && buildData.lastBuild.getRevision() != null) {
String gitExe = "";
GitTool[] installations = ((hudson.plugins.git.GitTool.DescriptorImpl)Hudson.getInstance().getDescriptorByType(GitTool.DescriptorImpl.class)).getInstallations();
for(GitTool i : installations) {
Something went wrong with that request. Please try again.