Skip to content

Commit

Permalink
Implement supportsPolling and requiresWorkspaceForPolling
Browse files Browse the repository at this point in the history
Gets multiple git polling working with no workspace checked out

[FIXED JENKINS-25253]
  • Loading branch information
jwillemsen authored and rodrigc committed Apr 3, 2016
1 parent 9f53e8f commit 0cd660a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java
Expand Up @@ -162,6 +162,28 @@ public FilePath[] getModuleRoots(FilePath workspace, AbstractBuild build) {
return paths.toArray(new FilePath[paths.size()]);
}

// Only return supportsPolling when all scms do report back that
// they supports polling
@Override
public boolean supportsPolling()
{
for(SCM scm : scms) {
if (!scm.supportsPolling()) return false;
}
return true;
}

// When one scm does require a workspace we return true, else
// we don't need a workspace for polling
@Override
public boolean requiresWorkspaceForPolling()
{
for(SCM scm : scms) {
if (scm.requiresWorkspaceForPolling()) return true;
}
return false;
}

@Override
public ChangeLogParser createChangeLogParser() {
return new MultiSCMChangeLogParser(scms.toList());
Expand Down

0 comments on commit 0cd660a

Please sign in to comment.