diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-09-25 04:44:45 -0400 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-09-25 04:44:45 -0400 |
commit | 23bba6fb488d5ef307fd323e86e5b9214f48ecd5 (patch) | |
tree | f1c7665067127f1c14594dcb8ee59267c4f4bcf7 | |
parent | 51d95bbaea368ff34538943a0de0100e41015852 (diff) | |
parent | 4005f3c6934de556f3937b96d98f6eeb28c353bd (diff) | |
download | jgit-23bba6fb488d5ef307fd323e86e5b9214f48ecd5.tar.gz jgit-23bba6fb488d5ef307fd323e86e5b9214f48ecd5.zip |
Merge "Remove duplicate calls to DirCache.unlock on checkout"
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java | 9 |
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 ee162dd506..04f0077d86 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(); } |