Merge "Remove duplicate calls to DirCache.unlock on checkout"

This commit is contained in:
Robin Rosenberg 2011-09-25 04:44:45 -04:00 committed by Code Review
commit 23bba6fb48
1 changed files with 3 additions and 6 deletions

View File

@ -396,10 +396,9 @@ private boolean doCheckout() throws CorruptObjectException, IOException,
prescanOneTree(); prescanOneTree();
if (!conflicts.isEmpty()) { if (!conflicts.isEmpty()) {
if (failOnConflict) { if (failOnConflict)
dc.unlock();
throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()])); throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()]));
} else else
cleanUpConflicts(); cleanUpConflicts();
} }
@ -448,10 +447,8 @@ private boolean doCheckout() throws CorruptObjectException, IOException,
} }
// commit the index builder - a new index is persisted // commit the index builder - a new index is persisted
if (!builder.commit()) { if (!builder.commit())
dc.unlock();
throw new IndexWriteException(); throw new IndexWriteException();
}
} finally { } finally {
objectReader.release(); objectReader.release();
} }