* [EGIT PATCH] Circumvent situations where Eclipse tries to decorate externally linked resources
@ 2009-01-21 22:33 Charles O'Farrell
0 siblings, 0 replies; only message in thread
From: Charles O'Farrell @ 2009-01-21 22:33 UTC (permalink / raw)
To: git
This occurs in one our projects which has an externally linked folder, which
causes the decorator to die on a NPE. Alternatively rsrc.isLinked() could
have been used, but we allow for linked resources to repository files.
Signed-off-by: Charles O'Farrell <charleso@charleso.org>
---
.../internal/decorators/GitResourceDecorator.java | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
index c3ae52d..f24b1eb 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
@@ -296,6 +296,12 @@ public void decorate(final Object element, final IDecoration decoration) {
Repository repository = mapped.getRepository();
GitIndex index = repository.getIndex();
String repoRelativePath = mapped.getRepoRelativePath(rsrc);
+
+ if (repoRelativePath == null) {
+ Activator.trace("Cannot decorate linked resource " + rsrc);
+ return;
+ }
+
Tree headTree = repository.mapTree(Constants.HEAD);
TreeEntry blob = headTree!=null ? headTree.findBlobMember(repoRelativePath) : null;
Entry entry = index.getEntry(repoRelativePath);
--
1.6.1.9.g97c34
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-21 22:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 22:33 [EGIT PATCH] Circumvent situations where Eclipse tries to decorate externally linked resources Charles O'Farrell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).