Browse Source

Remove duplicate calls to DirCache.unlock on checkout

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>
stable-1.2
Kevin Sawicki 13 years ago
parent
commit
4005f3c693
  1. 9
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java

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

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

Loading…
Cancel
Save