aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLluis Sanchez2010-11-10 04:39:48 (EST)
committerLluis Sanchez2010-11-10 04:56:46 (EST)
commit3b4dcb3c02b2d91182148caa83b6492664718500 (patch)
treec770bffdf7ea7ddd359d50a0d71e3c047f7f76c6
parent17b1003ff221a7ab7d8ef749e15e1a753efd6109 (diff)
downloadjgit-3b4dcb3c02b2d91182148caa83b6492664718500.zip
jgit-3b4dcb3c02b2d91182148caa83b6492664718500.tar.gz
jgit-3b4dcb3c02b2d91182148caa83b6492664718500.tar.bz2
Fix null ref exception in DirCacheCheckoutrefs/changes/77/1877/1
Added missing null check for getDirCacheEntry(). This method may return null for example if the curernt entry is a subtree.
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index 5b71dc0..bc51aa5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -274,8 +274,9 @@ public class DirCacheCheckout {
WorkingTreeIterator f) {
if (m != null) {
if (i == null || f == null || !m.idEqual(i)
- || f.isModified(i.getDirCacheEntry(), true,
- config_filemode(), repo.getFS())) {
+ || (i.getDirCacheEntry() != null && f.isModified(i
+ .getDirCacheEntry(), true, config_filemode(), repo
+ .getFS()))) {
update(m.getEntryPathString(), m.getEntryObjectId(),
m.getEntryFileMode());
} else