The temporary file (if created) is deleted before returning.
305306307308309310311312313314315
edit.commit(); } catch (IOException e) { throw new RuntimeException(e); } finally { if (dc != null) dc.unlock(); } } private void resetIndex(RevCommit commit) throws IOException { DirCache dc = null;
322323324325326327328329330331332
dcb.commit(); } catch (IOException e) { throw e; } finally { if (dc != null) dc.unlock(); } } private void checkoutIndex(RevCommit commit) throws IOException { DirCache dc = null;
338339340341342343344345346347348
checkout.checkout(); } catch (IOException e) { throw e; } finally { if (dc != null) dc.unlock(); } } private void resetMerge() throws IOException { repo.writeMergeHeads(null);
216217218219220221222223224225226
throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e); } finally { inserter.release(); if (dc != null) dc.unlock(); } return dc; }
264265266267268269270271272273274
} } finally { odi.release(); } } finally { index.unlock(); } } catch (UnmergedPathException e) { // since UnmergedPathException is a subclass of IOException // which should not be wrapped by a JGitInternalException we // have to catch and re-throw it here
283284285286287288289290291292293
} finally { startWalk.release(); r.release(); } } finally { dc.unlock(); revWalk.release(); } return this; }
333334335336337338339340341342343
FileUtils.delete(fileToDelete, FileUtils.RECURSIVE | FileUtils.RETRY); } } } finally { dc.unlock(); } RevWalk rw = new RevWalk(repo); RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD)); rw.release(); return commit;
254255256257258259260261262263264
268269270271272273274275276277278
File workTree = repo.getWorkTree(); for (String file : files) DirCacheCheckout.checkoutEntry(repo, new File(workTree, file), dc.getEntry(file)); } finally { dc.unlock(); revWalk.release(); } return this; }
292293294295296297298299300301302