aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Baumgart2011-06-29 08:18:00 (EDT)
committerJens Baumgart2011-06-29 08:18:00 (EDT)
commiteb46d7ffdc6dee1f8570d4be3b6c33cee8fa91c7 (patch)
treee8f09e8b57e95f06d00924e3cf177a12da0ba91b
parent553920088dcf93f27e6fd2042658c23ef6ea7cba (diff)
downloadjgit-eb46d7ffdc6dee1f8570d4be3b6c33cee8fa91c7.zip
jgit-eb46d7ffdc6dee1f8570d4be3b6c33cee8fa91c7.tar.gz
jgit-eb46d7ffdc6dee1f8570d4be3b6c33cee8fa91c7.tar.bz2
DirCacheCheckout: unlock DirCache in case of failurerefs/changes/99/3799/1
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java10
1 files changed, 10 insertions, 0 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 9a99408..6a1669b 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();