/** * Create a new in memory index read from the contents of a tree. * * @param reader * reader to access the tree objects from a repository. * @param treeId * tree to read. Must identify a tree, not a tree-ish. * @return a new cache which has no backing store file, but contains the * contents of {@code treeId}. * @throws java.io.IOException * one or more trees not available from the ObjectReader. * @since 4.2 */ public static DirCache read(ObjectReader reader, AnyObjectId treeId) throws IOException { DirCache d = newInCore(); DirCacheBuilder b = d.builder(); b.addTree(null, DirCacheEntry.STAGE_0, reader, treeId); b.finish(); return d; }
private void add(int tree, int stage) throws IOException { final AbstractTreeIterator i = getTree(tree); if (i != null) { if (FileMode.TREE.equals(tw.getRawMode(tree))) { builder.addTree(tw.getRawPath(), stage, reader, tw .getObjectId(tree)); } else { final DirCacheEntry e; e = new DirCacheEntry(tw.getRawPath(), stage); e.setObjectIdFromRaw(i.idBuffer(), i.idOffset()); e.setFileMode(tw.getFileMode(tree)); builder.add(e); } } }
public static void addTree(@Nonnull String path, @Nonnull AnyObjectId treeId, @Nonnull DirCacheBuilder builder, @Nonnull ObjectReader reader) throws IOException { builder.addTree(TreeUtils.normalizeTreePath(path).getBytes(), DirCacheEntry.STAGE_0, reader, treeId); }
public static void addTree(String path, AnyObjectId treeId, DirCacheBuilder builder, ObjectReader reader) throws IOException { builder.addTree(encode(normalizeNodePath(path)), STAGE_0, reader, treeId); }
public static void addTree(String path, AnyObjectId treeId, DirCacheBuilder builder, ObjectReader reader) throws IOException { builder.addTree(encode(normalizeNodePath(path)), STAGE_0, reader, treeId); }
/** * Create a new in memory index read from the contents of a tree. * * @param reader * reader to access the tree objects from a repository. * @param treeId * tree to read. Must identify a tree, not a tree-ish. * @return a new cache which has no backing store file, but contains the * contents of {@code treeId}. * @throws IOException * one or more trees not available from the ObjectReader. * @since 4.2 */ public static DirCache read(ObjectReader reader, AnyObjectId treeId) throws IOException { DirCache d = newInCore(); DirCacheBuilder b = d.builder(); b.addTree(null, DirCacheEntry.STAGE_0, reader, treeId); b.finish(); return d; }
/** * Create a new in memory index read from the contents of a tree. * * @param reader * reader to access the tree objects from a repository. * @param treeId * tree to read. Must identify a tree, not a tree-ish. * @return a new cache which has no backing store file, but contains the * contents of {@code treeId}. * @throws java.io.IOException * one or more trees not available from the ObjectReader. * @since 4.2 */ public static DirCache read(ObjectReader reader, AnyObjectId treeId) throws IOException { DirCache d = newInCore(); DirCacheBuilder b = d.builder(); b.addTree(null, DirCacheEntry.STAGE_0, reader, treeId); b.finish(); return d; }
private void add(int tree, int stage) throws IOException { final AbstractTreeIterator i = getTree(tree); if (i != null) { if (FileMode.TREE.equals(tw.getRawMode(tree))) { builder.addTree(tw.getRawPath(), stage, reader, tw .getObjectId(tree)); } else { final DirCacheEntry e; e = new DirCacheEntry(tw.getRawPath(), stage); e.setObjectIdFromRaw(i.idBuffer(), i.idOffset()); e.setFileMode(tw.getFileMode(tree)); builder.add(e); } } }
private void add(final int tree, final int stage) throws IOException { final AbstractTreeIterator i = getTree(tree); if (i != null) { if (FileMode.TREE.equals(tw.getRawMode(tree))) { builder.addTree(tw.getRawPath(), stage, reader, tw .getObjectId(tree)); } else { final DirCacheEntry e; e = new DirCacheEntry(tw.getRawPath(), stage); e.setObjectIdFromRaw(i.idBuffer(), i.idOffset()); e.setFileMode(tw.getFileMode(tree)); builder.add(e); } } }
builder.addTree(EMPTY_BYTE, 0, reader, baseTreeId); builder.finish();
builder.addTree(EMPTY_BYTE, 0, reader, baseTreeId); builder.finish();
builder.addTree(EMPTY_BYTE, 0, reader, baseTreeId); builder.finish();