Source:
public List<IProject> run(IProgressMonitor monitor) throws TeamException { final Map<URIish, Map<String, Set<ProjectReference>>> repositories = parseReferenceStrings(); final List<IProject> importedProjects = new ArrayList<IProject>(); for (final Map.Entry<URIish, Map<String, Set<ProjectReference>>> entry : repositories .entrySet()) { final URIish gitUrl = entry.getKey(); final Map<String, Set<ProjectReference>> branches = entry .getValue(); for (final Map.Entry<String, Set<ProjectReference>> branchEntry : branches .entrySet()) { final String branch = branchEntry.getKey(); final Set<ProjectReference> projects = branchEntry.getValue(); final IPath workDir = getWorkingDir(gitUrl, branch, branches.keySet()); final File repositoryPath = workDir.append( Constants.DOT_GIT_EXT).toFile(); boolean shouldClone = true; if (workDir.toFile().exists()) { if (repositoryAlreadyExistsForUrl(repositoryPath, gitUrl)) { shouldClone = false; } else { final Collection<String> projectNames = new LinkedList<String>(); for (final ProjectReference projectReference : projects) projectNames.add(projectReference.getProjectDir()); throw new TeamException( NLS.bind( CoreText.GitProjectSetCapability_CloneToExistingDirectory, new Object[] { workDir, projectNames, gitUrl })); } } try { if (shouldClone) { int timeout = 60; String refName = Constants.R_HEADS + branch; final CloneOperation cloneOperation = new CloneOperation( gitUrl, true, null, workDir.toFile(), refName, Constants.DEFAULT_REMOTE_NAME, timeout); cloneOperation.run(monitor); } Activator.getDefault().getRepositoryUtil() .addConfiguredRepository(repositoryPath); List<IProject> p = importProjects(projects, workDir, repositoryPath, monitor); importedProjects.addAll(p); } catch (final InvocationTargetException e) { throw getTeamException(e); } catch (final InterruptedException e) { return Collections.emptyList(); } } } return importedProjects; }

Target:
public List<IProject> run(IProgressMonitor monitor) throws TeamException { final Map<URIish, Map<String, Set<ProjectReference>>> repositories = parseReferenceStrings(); final List<IProject> importedProjects = new ArrayList<IProject>(); for (final Map.Entry<URIish, Map<String, Set<ProjectReference>>> entry : repositories .entrySet()) { final URIish gitUrl = entry.getKey(); final Map<String, Set<ProjectReference>> branches = entry .getValue(); for (final Map.Entry<String, Set<ProjectReference>> branchEntry : branches .entrySet()) { final String branch = branchEntry.getKey(); final Set<ProjectReference> projects = branchEntry.getValue(); final IPath workDir = getWorkingDir(gitUrl, branch, branches.keySet()); final File repositoryPath = workDir.append( Constants.DOT_GIT_EXT).toFile(); boolean shouldClone = true; if (workDir.toFile().exists()) { if (repositoryAlreadyExistsForUrl(repositoryPath, gitUrl)) shouldClone = false; else { final Collection<String> projectNames = new LinkedList<String>(); for (final ProjectReference projectReference : projects) projectNames.add(projectReference.getProjectDir()); throw new TeamException( NLS.bind( CoreText.GitProjectSetCapability_CloneToExistingDirectory, new Object[] { workDir, projectNames, gitUrl })); } } try { if (shouldClone) { int timeout = 60; String refName = Constants.R_HEADS + branch; final CloneOperation cloneOperation = new CloneOperation( gitUrl, true, null, workDir.toFile(), refName, Constants.DEFAULT_REMOTE_NAME, timeout); cloneOperation.run(monitor); } Activator.getDefault().getRepositoryUtil() .addConfiguredRepository(repositoryPath); List<IProject> p = importProjects(projects, workDir, repositoryPath, monitor); importedProjects.addAll(p); } catch (final InvocationTargetException e) { throw getTeamException(e); } catch (final InterruptedException e) { return Collections.emptyList(); } } } return importedProjects; }