aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-09-13 18:29:55 (EDT)
committerKevin Sawicki2011-09-13 18:29:55 (EDT)
commit4005f3c6934de556f3937b96d98f6eeb28c353bd (patch)
treed51e2d69a86ff3ac8cac0f1c35fccf4321b1a9d7
parentcc4e6109e40ac6f761b302b24bd6a793393090d5 (diff)
downloadjgit-4005f3c6934de556f3937b96d98f6eeb28c353bd.zip
jgit-4005f3c6934de556f3937b96d98f6eeb28c353bd.tar.gz
jgit-4005f3c6934de556f3937b96d98f6eeb28c353bd.tar.bz2
Remove duplicate calls to DirCache.unlock on checkoutrefs/changes/40/4240/1
Calls to unlock the DirCache before throwing an exception were not needed since checkout calls doCheckout wrapped in a try block that calls DirCache.unlock in a finally block. Change-Id: I2b249a784f9e363430e288aad67fcefb7fac0a6e Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java9
1 files changed, 3 insertions, 6 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 ee162dd..04f0077 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -396,10 +396,9 @@ public class DirCacheCheckout {
prescanOneTree();
if (!conflicts.isEmpty()) {
- if (failOnConflict) {
- dc.unlock();
+ if (failOnConflict)
throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()]));
- } else
+ else
cleanUpConflicts();
}
@@ -448,10 +447,8 @@ public class DirCacheCheckout {
}
// commit the index builder - a new index is persisted
- if (!builder.commit()) {
- dc.unlock();
+ if (!builder.commit())
throw new IndexWriteException();
- }
} finally {
objectReader.release();
}