From 7f37ec7cb9729db5ef8db83fdb2cf684c3155dcb Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Mon, 10 Sep 2018 09:58:45 +0200 Subject: [PATCH] Don't auto-refresh projects with missing .project file Doing so results in a ResourceException. Auto-closing such projects doesn't seem to be right; it would remain closed after the .project file re-appeared due to some other git operation. Not refreshing appears to be the best bet in this case. Bug: 538846 Change-Id: Icf01ec0f467bbcc5f7b13ab3b5914779c16b8a2a Signed-off-by: Thomas Wolf Signed-off-by: Matthias Sohn --- org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java index d618df5a9..fa0404ca9 100755 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java @@ -35,6 +35,7 @@ import java.util.stream.Stream; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspaceRunnable; @@ -653,7 +654,11 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener if (project.isAccessible()) { IPath path = project.getLocation(); if (path != null) { - result.put(path, project); + IPath projectFilePath = path.append( + IProjectDescription.DESCRIPTION_FILE_NAME); + if (projectFilePath.toFile().exists()) { + result.put(path, project); + } } } } -- 2.11.4.GIT