Do not refresh projects that use a PessimisticResourceRuleFactory
commita8f3b251792dc203433db89300c744c55c8ab4b0
authorThomas Wolf <thomas.wolf@paranor.ch>
Mon, 2 Jul 2018 11:06:22 +0000 (2 13:06 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Mon, 2 Jul 2018 12:10:42 +0000 (2 14:10 +0200)
tree12adbee98dea39a092c8780b558a7ceff64082f9
parent44d6b4988e57a7534b6a0f2115fd00483acf3c63
Do not refresh projects that use a PessimisticResourceRuleFactory

With some setups where the Eclipse workspace is inside the git
working tree EGit may end up trying to refresh a project that
needs the workspace root as scheduling rule for a refresh. EGit
generally uses multi-rules containing affected projects, though,
and thus it may run into an IAE in that case.

EGit-managed projects use an optimistic rule factory that uses the
project itself as scheduling rule. So do normal unshared projects.
So this can only occur if there are projects inside the git working
tree that are not shared with EGit but with some other provider that
does not use an optimistic rule factory. This is a rare occurrence,
and such projects had better be git-ignored, too. Not refreshing such
projects is a thus viable approach.

Bug: 536472
Change-Id: I17c06fd69e232a7b864a98c4e95598fa7ab6b7b0
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/util/ProjectUtilTest.java
org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java