{
performAction( "check-working-directory", context );
boolean workingDirectoryExists = CheckWorkingDirectoryAction.isWorkingDirectoryExist( context );
ScmResult scmResult;
if ( workingDirectoryExists )
{
performAction( "update-working-directory-from-scm", context );
scmResult = UpdateWorkingDirectoryFromScmContinuumAction.getUpdateScmResult( context );
}
else
{
Project project = AbstractContinuumAction.getProject( context );
AbstractContinuumAction.setWorkingDirectory( context, workingDirectoryService.getWorkingDirectory(
project ).getAbsolutePath() );
performAction( "checkout-project", context );
scmResult = CheckoutProjectContinuumAction.getCheckoutResult( context, null );
}
// [CONTINUUM-2207] when returned scmResult is null, this causes a problem when building the project
if ( scmResult == null )
{
log.debug( "Returned ScmResult is null when updating the working directory" );
scmResult = new ScmResult();
}
AbstractContinuumAction.setScmResult( context, scmResult );
}