/** * Create a new blob object in the repository. * * @param content * binary file content. * @return reference to the blob. * @throws Exception */ public RevBlob blob(final byte[] content) throws Exception { ObjectId id; try { id = inserter.insert(Constants.OBJ_BLOB, content); inserter.flush(); } finally { inserter.release(); } return pool.lookupBlob(id); }
oi.release(); pm.endTask();
@Override protected void run() throws Exception { BufferedInputStream in = new BufferedInputStream(ins); ObjectInserter inserter = db.newObjectInserter(); try { PackParser p = inserter.newPackParser(in); p.setAllowThin(fixThin); if (indexVersion != -1 && p instanceof ObjectDirectoryPackParser) { ObjectDirectoryPackParser imp = (ObjectDirectoryPackParser) p; imp.setIndexVersion(indexVersion); } p.parse(new TextProgressMonitor()); inserter.flush(); } finally { inserter.release(); } } }
inserter.flush(); } finally { inserter.release();
inserter.flush(); } finally { inserter.release();
/** * Construct a tree from a specific listing of file entries. * * @param entries * the files to include in the tree. The collection does not need * to be sorted properly and may be empty. * @return reference to the tree specified by the entry list. * @throws Exception */ public RevTree tree(final DirCacheEntry... entries) throws Exception { final DirCache dc = DirCache.newInCore(); final DirCacheBuilder b = dc.builder(); for (final DirCacheEntry e : entries) b.add(e); b.finish(); ObjectId root; try { root = dc.writeTree(inserter); inserter.flush(); } finally { inserter.release(); } return pool.lookupTree(root); }
throw new RuntimeException( e ); } finally { inserter.release();
throw new RuntimeException(e); } finally { inserter.release();
inserter.release();