Permalink
Browse files

[FIX JENKINS-29066] Revert "Can poll without workspace"

This reverts commit ccd4efa.
  • Loading branch information...
ndeloof committed Jun 26, 2015
1 parent 199f5e8 commit e5c75f18c4d68d55bc9950f006ff76b4092eb933
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/hudson/plugins/git/GitSCM.java
@@ -518,7 +518,7 @@ private boolean requiresWorkspaceForPolling(EnvVars environment) {
for (GitSCMExtension ext : getExtensions()) {
if (ext.requiresWorkspaceForPolling()) return true;
}
return false;
return getSingleBranch(environment) == null;
}

@Override
@@ -566,6 +566,8 @@ private PollingResult compareRemoteRevisionWithImpl(Job<?, ?> project, Launcher

final EnvVars pollEnv = project instanceof AbstractProject ? GitUtils.getPollEnvironment((AbstractProject) project, workspace, launcher, listener, false) : lastBuild.getEnvironment(listener);

final String singleBranch = getSingleBranch(pollEnv);

if (!requiresWorkspaceForPolling(pollEnv)) {

final EnvVars environment = project instanceof AbstractProject ? GitUtils.getPollEnvironment((AbstractProject) project, workspace, launcher, listener, false) : new EnvVars();
@@ -654,7 +656,6 @@ private PollingResult compareRemoteRevisionWithImpl(Job<?, ?> project, Launcher

listener.getLogger().println("Polling for changes in");

final String singleBranch = getSingleBranch(pollEnv);
Collection<Revision> candidates = getBuildChooser().getCandidateRevisions(
true, singleBranch, git, listener, buildData, new BuildChooserContextImpl(project, null, environment));

0 comments on commit e5c75f1

Please sign in to comment.