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 684cf21ae..5458426b1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -417,7 +417,7 @@ public class DirCacheCheckout { builder.finish(); File file = null; - String last = ""; //$NON-NLS-1$ + String last = null; // when deleting files process them in the opposite order as they have // been reported. This ensures the files are deleted before we delete // their parent folders @@ -433,7 +433,7 @@ public class DirCacheCheckout { if (!file.isDirectory()) toBeDeleted.add(r); } else { - if (!isSamePrefix(r, last)) + if (last != null && !isSamePrefix(r, last)) removeEmptyParents(new File(repo.getWorkTree(), last)); last = r; }