{
try
{
boolean removeWorkingDirectory = false;
Project p = projectDao.getProject( project.getId() );
ProjectScmRoot projectScmRoot = null;
if ( !p.getScmUrl().equals( project.getScmUrl() ) )
{
removeWorkingDirectory = true;
projectScmRoot = getProjectScmRootByProject( project.getId() );
}
if ( !p.getProjectGroup().equals( project.getProjectGroup() ) )
{
projectScmRoot = getProjectScmRootByProject( project.getId() );
}
if ( StringUtils.isEmpty( p.getScmTag() ) && !StringUtils.isEmpty( project.getScmTag() ) )
{
removeWorkingDirectory = true;
}
else if ( !StringUtils.isEmpty( p.getScmTag() ) && StringUtils.isEmpty( project.getScmTag() ) )
{
removeWorkingDirectory = true;
}
else if ( !StringUtils.isEmpty( p.getScmTag() ) && !p.getScmTag().equals( project.getScmTag() ) )
{
removeWorkingDirectory = true;
}
if ( removeWorkingDirectory )