Skip to content
Permalink
Browse files

[FIXED JENKINS-14321] don't reuse last build environment for fast pol…

…ling
  • Loading branch information...
ndeloof committed Aug 8, 2012
1 parent e1c5736 commit 3d9a73d26b129249c51fccfca6060280197b25eb
@@ -678,7 +678,7 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project,
break;
}
}
final EnvVars environment = GitUtils.getPollEnvironment(project, workspace, launcher, listener);
final EnvVars environment = GitUtils.getPollEnvironment(project, workspace, launcher, listener, false);
IGitAPI git = new GitAPI(gitExe, workspace, listener, environment, reference);
String gitRepo = getParamExpandedRepos(lastBuild).get(0).getURIs().get(0).toString();
String headRevision = git.getHeadRev(gitRepo, getBranches().get(0).getName());
@@ -171,11 +171,17 @@ public Revision getRevisionForSHA1(ObjectId sha1) throws GitException, IOExcepti
return l;
}

public static EnvVars getPollEnvironment(AbstractProject p, FilePath ws, Launcher launcher, TaskListener listener)
throws IOException, InterruptedException {
return getPollEnvironment(p, ws, launcher, listener, true);
}


/**
* An attempt to generate at least semi-useful EnvVars for polling calls, based on previous build.
* Cribbed from various places.
*/
public static EnvVars getPollEnvironment(AbstractProject p, FilePath ws, Launcher launcher, TaskListener listener)
public static EnvVars getPollEnvironment(AbstractProject p, FilePath ws, Launcher launcher, TaskListener listener, boolean reuseLastBuildEnv)
throws IOException,InterruptedException {
EnvVars env;
StreamBuildListener buildListener = new StreamBuildListener((OutputStream)listener.getLogger());

1 comment on commit 3d9a73d

@ciaranj

This comment has been minimized.

Copy link

commented on 3d9a73d Aug 8, 2012

This should fix my out-standing pull request: #75 Would you mind closing it please ?

Please sign in to comment.
You can’t perform that action at this time.