From: "Charles O'Farrell" <charleso@charleso.org>
To: git@vger.kernel.org
Subject: [EGIT PATCH] Circumvent situations where Eclipse tries to decorate externally linked resources
Date: Thu, 22 Jan 2009 08:33:51 +1000 [thread overview]
Message-ID: <1232577231-3944-1-git-send-email-charleso@charleso.org> (raw)
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
reply other threads:[~2009-01-21 22:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1232577231-3944-1-git-send-email-charleso@charleso.org \
--to=charleso@charleso.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).