reader.release();
public void widgetDisposed(DisposeEvent e) { if (reader != null) reader.release(); } });
public void widgetDisposed(DisposeEvent e) { if (objectReader != null) objectReader.release(); } });
public void widgetDisposed(DisposeEvent e) { if (reader != null) reader.release(); } });
@Override public void release() { recentChunks.clear(); endPrefetch(); InflaterCache.release(inflater); inflater = null; super.release(); }
@Override public void release() { recentChunks.clear(); endPrefetch(); InflaterCache.release(inflater); inflater = null; super.release(); }
private CanonicalTreeParser createTreeIterator(RevTree tree) { CanonicalTreeParser treeParser = new CanonicalTreeParser(); ObjectReader objectReader = repo.getGit().getRepository().newObjectReader(); try { treeParser.reset(objectReader, tree.getId()); } catch (IncorrectObjectTypeException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { objectReader.release(); } return treeParser; }
return null; } finally { reader.release();
/** * Creates a textual diff together with meta information. * TODO So far this works only in case of one parent commit. * * @param d * the StringBuilder where the textual diff is added to * @param db * the Repo * @param diffFmt * the DiffFormatter used to create the textual diff * @param gitFormat * if false, do not show any source or destination prefix, * and the paths are calculated relative to the eclipse * project, otherwise relative to the git repository * @throws IOException */ public void outputDiff(final StringBuilder d, final Repository db, final DiffFormatter diffFmt, boolean gitFormat) throws IOException { if (gitFormat) { diffFmt.setRepository(db); diffFmt.format(diffEntry); return; } ObjectReader reader = db.newObjectReader(); try { outputEclipseDiff(d, db, reader, diffFmt); } finally { reader.release(); } }
commits.add(c); } finally { curs.release(); db = null; rw = null;
throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } finally { curs.release();
protected void showFetchResult(final FetchResult r) throws IOException { ObjectReader reader = db.newObjectReader(); try { boolean shownURI = false; for (final TrackingRefUpdate u : r.getTrackingRefUpdates()) { if (!verbose && u.getResult() == RefUpdate.Result.NO_CHANGE) continue; final char type = shortTypeOf(u.getResult()); final String longType = longTypeOf(reader, u); final String src = abbreviateRef(u.getRemoteName(), false); final String dst = abbreviateRef(u.getLocalName(), true); if (!shownURI) { outw.println(MessageFormat.format(CLIText.get().fromURI, r.getURI())); shownURI = true; } outw.format(" %c %-17s %-10s -> %s", valueOf(type), longType, //$NON-NLS-1$ src, dst); outw.println(); } } finally { reader.release(); } showRemoteMessages(errw, r.getMessages()); }
ObjectLoader objectLoader = objectReader.open( tagRef.getObjectId() ); RevTag tag = RevTag.parse( objectLoader.getBytes() ); objectReader.release(); assertEquals( commit.getId(), tag.getObject() );
p.reset(reader, head); } finally { reader.release();
@Override protected void run() throws Exception { Git git = new Git(db); PushCommand push = git.push(); push.setDryRun(dryRun); push.setForce(force); push.setProgressMonitor(new TextProgressMonitor()); push.setReceivePack(receivePack); push.setRefSpecs(refSpecs); if (all) push.setPushAll(); if (tags) push.setPushTags(); push.setRemote(remote); push.setThin(thin); push.setTimeout(timeout); Iterable<PushResult> results = push.call(); for (PushResult result : results) { ObjectReader reader = db.newObjectReader(); try { printPushResult(reader, result.getURI(), result); } finally { reader.release(); } } }
} finally { if (reader != null) reader.release(); rw.dispose();