summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDariusz Luksza2010-08-19 10:08:29 (EDT)
committer Chris Aniszczyk2010-08-19 10:34:34 (EDT)
commitff88637c69af6e114c3d8c722681f655943dfe23 (patch)
treef8f959477e06edd2b474b7887922895f0f828c21
parent25add621623a5eb15c26bd623510e862b1ef2b2f (diff)
downloadegit-ff88637c69af6e114c3d8c722681f655943dfe23.zip
egit-ff88637c69af6e114c3d8c722681f655943dfe23.tar.gz
egit-ff88637c69af6e114c3d8c722681f655943dfe23.tar.bz2
Fix NPE while opening CompareView for oldest commitrefs/changes/39/1339/3
We were here to strongly relay on JGti API and it caching. According to Shawn's mail[1] JGit disposes commit body when we 'thinks' that it isn't usable any more. Therefore we should always re-parse RevCommit objects before we want to obtain data from them. [1] http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg00566.html Bug: 322732 Change-Id: I6691e4c7085434de28ec81c4634ce341662b3433 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
index 88d0e2f..df519a7 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
@@ -26,6 +26,7 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileRevision;
@@ -55,6 +56,11 @@ class CommitFileRevision extends GitFileRevision {
final String fileName, final ObjectId blob) {
super(fileName);
db = repo;
+ try {
+ new RevWalk(db).parseBody(rc);
+ } catch (IOException e) {
+ Activator.logError(e.getMessage(), e);
+ }
commit = rc;
author = rc.getAuthorIdent();
path = fileName;