/** * Write all index trees to the object store, returning the root tree. * * @param ow * the writer to use when serializing to the store. The caller is * responsible for flushing the inserter before trying to use the * returned tree identity. * @return identity for the root tree. * @throws org.eclipse.jgit.errors.UnmergedPathException * one or more paths contain higher-order stages (stage > 0), * which cannot be stored in a tree object. * @throws java.lang.IllegalStateException * one or more paths contain an invalid mode which should never * appear in a tree object. * @throws java.io.IOException * an unexpected error occurred writing to the object store. */ public ObjectId writeTree(ObjectInserter ow) throws UnmergedPathException, IOException { return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow); }
/** * Create a new iterator for an already loaded DirCache instance. * <p> * The iterator implementation may copy part of the cache's data during * construction, so the cache must be read in prior to creating the * iterator. * * @param dc * the cache to walk. It must be already loaded into memory. */ public DirCacheIterator(DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; treeEnd = tree.getEntrySpan(); subtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) parseEntry(); }
/** * Write all index trees to the object store, returning the root tree. * * @param ow * the writer to use when serializing to the store. The caller is * responsible for flushing the inserter before trying to use the * returned tree identity. * @return identity for the root tree. * @throws UnmergedPathException * one or more paths contain higher-order stages (stage > 0), * which cannot be stored in a tree object. * @throws IllegalStateException * one or more paths contain an invalid mode which should never * appear in a tree object. * @throws IOException * an unexpected error occurred writing to the object store. */ public ObjectId writeTree(final ObjectInserter ow) throws UnmergedPathException, IOException { return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow); }
/** * Write all index trees to the object store, returning the root tree. * * @param ow * the writer to use when serializing to the store. The caller is * responsible for flushing the inserter before trying to use the * returned tree identity. * @return identity for the root tree. * @throws org.eclipse.jgit.errors.UnmergedPathException * one or more paths contain higher-order stages (stage > 0), * which cannot be stored in a tree object. * @throws java.lang.IllegalStateException * one or more paths contain an invalid mode which should never * appear in a tree object. * @throws java.io.IOException * an unexpected error occurred writing to the object store. */ public ObjectId writeTree(ObjectInserter ow) throws UnmergedPathException, IOException { return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow); }
@Override protected void run() throws Exception { final DirCache cache = db.readDirCache(); final DirCacheTree tree = cache.getCacheTree(true); show(tree); }
/** * Create a new iterator for an already loaded DirCache instance. * <p> * The iterator implementation may copy part of the cache's data during * construction, so the cache must be read in prior to creating the * iterator. * * @param dc * the cache to walk. It must be already loaded into memory. */ public DirCacheIterator(DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; treeEnd = tree.getEntrySpan(); subtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) parseEntry(); }
/** * Create a new iterator for an already loaded DirCache instance. * <p> * The iterator implementation may copy part of the cache's data during * construction, so the cache must be read in prior to creating the * iterator. * * @param dc * the cache to walk. It must be already loaded into memory. */ public DirCacheIterator(final DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; treeEnd = tree.getEntrySpan(); subtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) parseEntry(); }
@Override protected void run() throws Exception { final DirCache cache = db.readDirCache(); final DirCacheTree tree = cache.getCacheTree(false); if (tree == null) throw die(CLIText.get().noTREESectionInIndex); show(tree); }