Ensure IProjects are not refreshed via IFile handles
commit48475bfcb044223bfcc111f440bc43863ea9f0b7
authorThomas Wolf <thomas.wolf@paranor.ch>
Wed, 18 Jul 2018 10:49:09 +0000 (18 12:49 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Wed, 18 Jul 2018 10:49:09 +0000 (18 12:49 +0200)
tree0e8a6ba46afb05b46947d64ce616d74ec9b7f507
parentcdbe0608d9756bdcf17fcb8eee245e911fe7ec96
Ensure IProjects are not refreshed via IFile handles

As it turns out a WorkingTreeModifiedEvent may contain directories
without trailing slashes. EGit refreshes files as IFiles. In some
cases, it would thus try to refresh a folder via an IFile. When such
a folder is a nested project, Eclipse may detect the aliased project
and will then raise an IAE if the refresh occurs via an IFile because
projects have only one path segment, but files need at least two.

Avoid this when we calculate which resources to refresh given the set
of paths modified by a git operation: check up-front whether the path
corresponds to a known project, and if so, refresh it via IProject.

Bug: 536880
Change-Id: I26cadec224852f4dc53187cc1103a511db78f370
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java