Skip to content

Commit

Permalink
[FIXED JENKINS-10880] check if the workspace is null when fast remote…
Browse files Browse the repository at this point in the history
… polling is enabled with multiple branches
  • Loading branch information
marc-guenther committed Apr 4, 2012
1 parent 0fbdcff commit edf0905
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit edf0905

Please sign in to comment.