private void doGerritConfiguration(final String remoteName, final CloneOperation op) { String gerritBranch = gerritConfiguration.getBranch(); URIish pushURI = gerritConfiguration.getURI(); if (gerritBranch != null && gerritBranch.length() > 0) { ConfigurePushAfterCloneTask push = new ConfigurePushAfterCloneTask( remoteName, "HEAD:refs/for/" + gerritBranch, pushURI); // $NON-NLS-1$ op.addPostCloneTask(push); } op.addPostCloneTask(new SetChangeIdTask(true)); }
public static void cloneRepository( String uri, String remoteName, File destination, PostCloneTask postCloneTask, IProgressMonitor monitor) throws URISyntaxException, InvocationTargetException, InterruptedException { URIish gitUri = new URIish(uri); CloneOperation cloneOperation = new CloneOperation( gitUri, true, null, destination, Constants.HEAD, remoteName, CLONE_TIMEOUT); if (postCloneTask != null) { cloneOperation.addPostCloneTask(postCloneTask); } cloneOperation.run(monitor); // RepositoryUtil repositoryUtil = // Activator.getDefault().getRepositoryUtil(); // repositoryUtil.addConfiguredRepository(new File(destination, // Constants.DOT_GIT)); }