summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJens Baumgart2010-08-05 12:02:38 (EDT)
committer Jens Baumgart2010-08-05 12:02:38 (EDT)
commit9b354e68d9e09778ca3843aa6751228f6e102f37 (patch)
tree21486a131e6773d026f9ad7036855493ececa9a3
parent7d64211cf2cb80492a9a6ee40752b7b77f78bb7a (diff)
downloadegit-9b354e68d9e09778ca3843aa6751228f6e102f37.zip
egit-9b354e68d9e09778ca3843aa6751228f6e102f37.tar.gz
egit-9b354e68d9e09778ca3843aa6751228f6e102f37.tar.bz2
Decoration of ignored projectsrefs/changes/43/1243/1
The decorator now decorates a project resource correctly if the project resource is ignored. Change-Id: I489dd4248d9b368908d3cc2685234f03586935d9 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceAdapter.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceAdapter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceAdapter.java
index aa7362c..7e484a4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceAdapter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceAdapter.java
@@ -22,6 +22,8 @@ import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.AdaptableFileTreeIterator;
import org.eclipse.egit.core.ContainerTreeIterator;
import org.eclipse.egit.core.ContainerTreeIterator.ResourceEntry;
@@ -210,10 +212,10 @@ class DecoratableResourceAdapter implements IDecoratableResource {
final WorkingTreeIterator workingTreeIterator = treeWalk.getTree(
T_WORKSPACE, WorkingTreeIterator.class);
- if (workingTreeIterator instanceof ContainerTreeIterator) {
- final ContainerTreeIterator workspaceIterator = treeWalk.getTree(
- T_WORKSPACE, ContainerTreeIterator.class);
- if (workspaceIterator != null) {
+ if (workingTreeIterator != null) {
+ if (workingTreeIterator instanceof ContainerTreeIterator) {
+ final ContainerTreeIterator workspaceIterator =
+ (ContainerTreeIterator) workingTreeIterator;
ResourceEntry resourceEntry = workspaceIterator
.getResourceEntry();
if (resource.equals(resourceEntry.getResource())
@@ -221,6 +223,19 @@ class DecoratableResourceAdapter implements IDecoratableResource {
ignored = true;
return false;
}
+ } else {
+ // For the project resource, it's still the
+ // AdaptableFileTreeIterator. So we have to compare the path
+ // of the resource with path of the iterator
+ IPath wdPath = new Path(repository.getWorkTree()
+ .getAbsolutePath()).append(workingTreeIterator
+ .getEntryPathString());
+ IPath resPath = resource.getLocation();
+ if (wdPath.equals(resPath)
+ && workingTreeIterator.isEntryIgnored()) {
+ ignored = true;
+ return false;
+ }
}
}
// Note: for obtaining the ignored info we have to go through the