A reader that has been released can be used again, but may need to be released after the subsequent usage.
324325326327328329330331332
// Return stashed commit return parseCommit(reader, commitId); } catch (IOException e) { throw new JGitInternalException(JGitText.get().stashFailed, e); } finally { reader.release(); } } }
247248249250251252253254255256257
failingPaths.put(fileName, MergeFailureReason.COULD_NOT_DELETE); modifiedFiles.add(fileName); } } finally { r.release(); } } private void createDir(File f) throws IOException { if (!f.isDirectory() && !f.mkdirs()) {
332333334335336337338339340
203204205206207208209210211212213
} catch (JGitInternalException e) { throw e; } catch (IOException e) { throw new JGitInternalException(JGitText.get().stashApplyFailed, e); } finally { reader.release(); } } /** * @param applyIndex
474475476477478479480481482483484
// commit the index builder - a new index is persisted if (!builder.commit()) throw new IndexWriteException(); } finally { objectReader.release(); } return toBeDeleted.size() == 0; } private static boolean isSamePrefix(String a, String b) {
10851086108710881089109010911092109310941095
DirCacheEntry entry) throws IOException { ObjectReader or = repository.newObjectReader(); try { checkoutEntry(repository, f, entry, repository.newObjectReader()); } finally { or.release(); } } /** * Updates the file in the working tree with content and mode from an entry
159160161162163164165166167168169
IncorrectObjectTypeException, CorruptObjectException, IOException { ObjectReader reader = db.newObjectReader(); try { return forPath(reader, path, trees); } finally { reader.release(); } } /** * Open a tree walk and filter to exactly one path.
8283848586878889909192
CanonicalTreeParser p = new CanonicalTreeParser(); ObjectReader reader = repo.newObjectReader(); try { p.reset( reader, head ); } finally { reader.release(); } oldTree = p; } newTree = new DirCacheIterator( repo.readDirCache() ); } else {