summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHiroshi Tomita2013-07-04 20:04:00 (EDT)
committer Hiroshi Tomita2013-07-04 20:09:04 (EDT)
commit8e307cde562250c49479a930f453f08e28cf051b (patch)
tree924850ae77ef25f0576d030484422c405c09d7fe
parent21b3a16ab7692230ca7e435f99f0623e21aa353c (diff)
downloadjgit-8e307cde562250c49479a930f453f08e28cf051b.zip
jgit-8e307cde562250c49479a930f453f08e28cf051b.tar.gz
jgit-8e307cde562250c49479a930f453f08e28cf051b.tar.bz2
Check parentFile is not nullrefs/changes/93/14293/1
parentFile becomes null when f is relative path, such as ".". This patch avoids NullPointerException in such case. Change-Id: I4752674b1daab6eedd7c3650c7749462810eaffd Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java2
1 files changed, 1 insertions, 1 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 6fb56ed..684cf21 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -475,7 +475,7 @@ public class DirCacheCheckout {
private void removeEmptyParents(File f) {
File parentFile = f.getParentFile();
- while (!parentFile.equals(repo.getWorkTree())) {
+ while (parentFile != null && !parentFile.equals(repo.getWorkTree())) {
if (!parentFile.delete())
break;
parentFile = parentFile.getParentFile();