Adapt to EGit singleton changes

Change-Id: I92919ac696606c46190922d7295cdb9ca279f4a5
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestUtils.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestUtils.java
index 3bc00c0..a23422f 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestUtils.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/pr/PullRequestUtils.java
@@ -72,11 +72,10 @@
 				.getRepo();
 		String id = remoteRepo.getOwner().getLogin() + '/'
 				+ remoteRepo.getName() + Constants.DOT_GIT;
-		RepositoryCache cache = RepositoryCache.getInstance();
-		for (String path : RepositoryUtil.getInstance()
-				.getConfiguredRepositories())
+		for (String path : RepositoryUtil.INSTANCE.getConfiguredRepositories())
 			try {
-				Repository repo = cache.lookupRepository(new File(path));
+				Repository repo = RepositoryCache.INSTANCE
+						.lookupRepository(new File(path));
 				RemoteConfig rc = new RemoteConfig(repo.getConfig(),
 						Constants.DEFAULT_REMOTE_NAME);
 				for (URIish uri : rc.getURIs())
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
index c3a7b89..ca23d1e 100755
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
@@ -108,7 +108,6 @@
 				monitor.beginTask(name, repositories.length * 3);
 				GitHubClient client = GitHub
 						.configureClient(new GitHubClient());
-				RepositoryUtil repositoryUtil = RepositoryUtil.getInstance();
 				RepositoryService service = new RepositoryService(client);
 				for (SearchRepository repo : repositories)
 					try {
@@ -129,7 +128,8 @@
 						monitor.setTaskName(MessageFormat
 								.format(Messages.RepositoryImportWizard_Registering,
 										id));
-						repositoryUtil.addConfiguredRepository(op.getGitDir());
+						RepositoryUtil.INSTANCE
+								.addConfiguredRepository(op.getGitDir());
 						monitor.worked(1);
 					} catch (InvocationTargetException e) {
 						GitHubUi.logError(e);
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java
index 7d94f7d..a956210 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java
@@ -67,10 +67,6 @@
 		return ResourcesPlugin.getWorkspace().getRoot();
 	}
 
-	private static RepositoryUtil getRepoUtil() {
-		return RepositoryUtil.getInstance();
-	}
-
 	/**
 	 * ID
 	 */
@@ -80,7 +76,8 @@
 	public boolean isEnabled(TaskData data) {
 		String id = getGistName(data);
 		return !getWorkspaceRoot().getProject(id).exists()
-				&& !getRepoUtil().getConfiguredRepositories().contains(id);
+				&& !RepositoryUtil.INSTANCE.getConfiguredRepositories()
+						.contains(id);
 	}
 
 	private File getParentDirectory() {
@@ -131,7 +128,7 @@
 		int timeout = GitSettings.getRemoteConnectionTimeout();
 		final File workDir = new File(getParentDirectory(), name);
 
-		if (getRepoUtil().getConfiguredRepositories().contains(
+		if (RepositoryUtil.INSTANCE.getConfiguredRepositories().contains(
 				new File(workDir, Constants.DOT_GIT).getAbsolutePath()))
 			throw new IOException(MessageFormat.format(
 					Messages.CloneGistHandler_ErrorRepoExists, name));
@@ -158,7 +155,7 @@
 							if (monitor.isCanceled())
 								return;
 							monitor.setTaskName(Messages.CloneGistHandler_TaskRegisteringRepository);
-							getRepoUtil().addConfiguredRepository(
+							RepositoryUtil.INSTANCE.addConfiguredRepository(
 									repository.getDirectory());
 						}
 					});