summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJens Baumgart2010-07-22 10:50:37 (EDT)
committer Jens Baumgart2010-07-22 10:50:37 (EDT)
commit8c6e4d382442e7ec5b5c767dc5d8fe7d7956b2b3 (patch)
treeeabb01eaee6cd31d7f8386461c6122e241387bf9
parentd56091d2ca902541c2236e42145db91c40d38d92 (diff)
downloadegit-8c6e4d382442e7ec5b5c767dc5d8fe7d7956b2b3.zip
egit-8c6e4d382442e7ec5b5c767dc5d8fe7d7956b2b3.tar.gz
egit-8c6e4d382442e7ec5b5c767dc5d8fe7d7956b2b3.tar.bz2
RepositoryView: do not display deleted repositoriesrefs/changes/68/1168/2
RepositoryView displayed repositores that became deleted between 2 Eclipse sessions. Change-Id: I3a064aa4b04d4509bd87659b58271dc018d28078 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
index e38e934..0bf7094 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
@@ -26,6 +26,7 @@ import java.util.Map.Entry;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.egit.core.RepositoryCache;
import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.RepositoryUtil;
import org.eclipse.egit.ui.UIText;
import org.eclipse.egit.ui.internal.repository.tree.BranchesNode;
import org.eclipse.egit.ui.internal.repository.tree.ErrorNode;
@@ -66,6 +67,7 @@ public class RepositoriesViewContentProvider implements ITreeContentProvider {
List<RepositoryTreeNode> nodes = new ArrayList<RepositoryTreeNode>();
List<String> directories = new ArrayList<String>();
+ RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil();
if (inputElement instanceof Collection) {
for (Iterator it = ((Collection) inputElement).iterator(); it
@@ -77,15 +79,18 @@ public class RepositoriesViewContentProvider implements ITreeContentProvider {
directories.add((String) next);
}
} else if (inputElement instanceof IWorkspaceRoot) {
- directories.addAll(Activator.getDefault().getRepositoryUtil()
- .getConfiguredRepositories());
+ directories.addAll(repositoryUtil.getConfiguredRepositories());
}
for (String directory : directories) {
try {
- RepositoryNode rNode = new RepositoryNode(null, repositoryCache
- .lookupRepository(new File(directory)));
- nodes.add(rNode);
+ File gitDir = new File(directory);
+ if (gitDir.exists()) {
+ RepositoryNode rNode = new RepositoryNode(null, repositoryCache
+ .lookupRepository(gitDir));
+ nodes.add(rNode);
+ } else
+ repositoryUtil.removeDir(gitDir);
} catch (IOException e) {
// ignore for now
}