Skip to content

Commit

Permalink
[FIXED JENKINS-14321] don't reuse last build environment for fast pol…
Browse files Browse the repository at this point in the history
…ling
  • Loading branch information
ndeloof committed Aug 8, 2012
1 parent e1c5736 commit 3d9a73d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -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());
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/hudson/plugins/git/util/GitUtils.java
Expand Up @@ -171,11 +171,17 @@ public List<Revision> filterTipBranches(Collection<Revision> revisions) {
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());
Expand Down

1 comment on commit 3d9a73d

@ciaranj
Copy link
Contributor

@ciaranj ciaranj commented on 3d9a73d Aug 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.