git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH] Circumvent situations where Eclipse tries to decorate externally linked resources

From
Charles O'Farrell <charleso@charleso.org>
Date
Jan 21, 2009, 22:33 UTC
Message-ID
<1232577231-3944-1-git-send-email-charleso@charleso.org>

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
Message 1 of 1 in “Circumvent situations where Eclipse tries to decorate externally linked resources”
  1. Circumvent situations where Eclipse tries to decorate externally linked resourcesCharles O'Farrell, Jan 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.