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 9a9940898..6a1669b4f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -375,6 +375,16 @@ public class DirCacheCheckout { * @throws IOException */ public boolean checkout() throws IOException { + try { + return doCheckout(); + } finally { + dc.unlock(); + } + } + + private boolean doCheckout() throws CorruptObjectException, IOException, + MissingObjectException, IncorrectObjectTypeException, + CheckoutConflictException, IndexWriteException { toBeDeleted.clear(); if (headCommitTree != null) preScanTwoTrees();