Skip to content
Permalink
Browse files

Merge pull request #61 from marc-guenther/master

[FIXED JENKINS-10880] check if the workspace is null when fast remote polling is enabled with multiple branches
  • Loading branch information
ndeloof committed Apr 5, 2012
2 parents f9f239a + edf0905 commit 11bef7f5da0d6a2f0fa6bbf6c262325bf4efea4a
Showing with 11 additions and 3 deletions.
  1. +8 −2 src/main/java/hudson/plugins/git/GitSCM.java
  2. +3 −1 src/main/webapp/help-fastremote.html
@@ -707,7 +707,9 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project,
// I'm actually not 100% sure about this, but I'll leave it in for now.
// Update 9/9/2010 - actually, I think this *was* needed, since we weren't doing a better check
// for whether we'd ever been built before. But I'm fixing that right now anyway.
if (!workingDirectory.exists()) {

// JENKINS-10880: workingDirectory can be null
if (workingDirectory == null || !workingDirectory.exists()) {
return PollingResult.BUILD_NOW;
}

@@ -1706,9 +1708,13 @@ protected FilePath workingDirectory(final FilePath workspace) {
* if no relative target dir is specified. Otherwise, it'll be "workspace/relativeTargetDir".
*
* @param workspace
* @return working directory
* @return working directory or null if workspace is null
*/
protected FilePath workingDirectory(final FilePath workspace, EnvVars environment) {
// JENKINS-10880: workspace can be null
if (workspace == null) {
return null;
}
if (relativeTargetDir == null || relativeTargetDir.length() == 0 || relativeTargetDir.equals(".")) {
return workspace;
}
@@ -1,3 +1,5 @@
<div>
Use git ls-remote polling mechanism. This will compare latest built commit SHA with remote branch without cloning a local copy of the repo
Use git ls-remote polling mechanism. This will compare the latest built commit SHA with the remote branch without cloning a local copy of the repo.<br><br>
If you want to use this, you can have only one repository with one branch (no wildcards!), and you can not use any excluded regions, excluded users or submodules, otherwise this option will disable itself after save.<br><br>
If this is turned off though, polling will require a workspace and might trigger unwanted builds (see <a href="https://issues.jenkins-ci.org/browse/JENKINS-10131" target="_blank">JENKINS-10131</a>).
</div>

0 comments on commit 11bef7f

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