Browse Source

DirCacheCheckout: unlock DirCache in case of failure

DirCacheCheckout did not unlock the index if e.g. an IOException occured
during checkout.

Bug: 350677
Change-Id: Ie9fa09f7a404080da7cdccafb9be3a8c845e4869
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
stable-1.1
Jens Baumgart 14 years ago
parent
commit
eb46d7ffdc
  1. 10
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java

10
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java vendored

@ -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();

Loading…
Cancel
Save