treeWalk.getObjectId(idBuffer, 0); throw new CorruptObjectException(MessageFormat.format(JGitText.get().corruptObjectInvalidMode3 , mode, idBuffer.name(), treeWalk.getPathString(), tree.name()));
public boolean matches(Pattern pattern, RevCommit commit) { RevTree tree = commit.getTree(); return tree != null ? matches(pattern, tree.name()) : false; } }
/** * Lookup an entry stored in a tree, failing if not present. * * @param tree * the tree to search. * @param path * the path to find the entry of. * @return the parsed object entry at this path, never null. * @throws Exception */ public RevObject get(final RevTree tree, final String path) throws Exception { final TreeWalk tw = new TreeWalk(pool.getObjectReader()); tw.setFilter(PathFilterGroup.createFromStrings(Collections .singleton(path))); tw.reset(tree); while (tw.next()) { if (tw.isSubtree() && !path.equals(tw.getPathString())) { tw.enterSubtree(); continue; } final ObjectId entid = tw.getObjectId(0); final FileMode entmode = tw.getFileMode(0); return pool.lookupAny(entid, entmode.getObjectType()); } fail("Can't find " + path + " in tree " + tree.name()); return null; // never reached. }
/** * Lookup an entry stored in a tree, failing if not present. * * @param tree * the tree to search. * @param path * the path to find the entry of. * @return the parsed object entry at this path, never null. * @throws Exception */ public RevObject get(RevTree tree, String path) throws Exception { try (TreeWalk tw = new TreeWalk(pool.getObjectReader())) { tw.setFilter(PathFilterGroup.createFromStrings(Collections .singleton(path))); tw.reset(tree); while (tw.next()) { if (tw.isSubtree() && !path.equals(tw.getPathString())) { tw.enterSubtree(); continue; } final ObjectId entid = tw.getObjectId(0); final FileMode entmode = tw.getFileMode(0); return pool.lookupAny(entid, entmode.getObjectType()); } } fail("Can't find " + path + " in tree " + tree.name()); return null; // never reached. }
/** * Lookup an entry stored in a tree, failing if not present. * * @param tree * the tree to search. * @param path * the path to find the entry of. * @return the parsed object entry at this path, never null. * @throws Exception */ public RevObject get(final RevTree tree, final String path) throws Exception { try (TreeWalk tw = new TreeWalk(pool.getObjectReader())) { tw.setFilter(PathFilterGroup.createFromStrings(Collections .singleton(path))); tw.reset(tree); while (tw.next()) { if (tw.isSubtree() && !path.equals(tw.getPathString())) { tw.enterSubtree(); continue; } final ObjectId entid = tw.getObjectId(0); final FileMode entmode = tw.getFileMode(0); return pool.lookupAny(entid, entmode.getObjectType()); } } fail("Can't find " + path + " in tree " + tree.name()); return null; // never reached. }
pw.printf("commit %s\n", commit.name()); pw.printf("tree %s\n", commit.getTree().name()); for (RevCommit p : commit.getParents()) pw.printf("parent %s\n",p.name());
treeWalk.getObjectId(idBuffer, 0); throw new CorruptObjectException(MessageFormat.format(JGitText.get().corruptObjectInvalidMode3 , mode, idBuffer.name(), treeWalk.getPathString(), tree.name()));
treeWalk.getObjectId(idBuffer, 0); throw new CorruptObjectException(MessageFormat.format(JGitText.get().corruptObjectInvalidMode3 , mode, idBuffer.name(), treeWalk.getPathString(), tree.name()));