本文整理匯總了Java中org.eclipse.jgit.treewalk.CanonicalTreeParser.eof方法的典型用法代碼示例。如果您正苦於以下問題:Java CanonicalTreeParser.eof方法的具體用法?Java CanonicalTreeParser.eof怎麽用?Java CanonicalTreeParser.eof使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jgit.treewalk.CanonicalTreeParser
的用法示例。
在下文中一共展示了CanonicalTreeParser.eof方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processTreeParser
import org.eclipse.jgit.treewalk.CanonicalTreeParser; //導入方法依賴的package包/類
private void processTreeParser(CanonicalTreeParser treeParser)
throws IOException {
TreeParserTreeEntry treeParserEntry = new TreeParserTreeEntry(
treeParser, objectReader);
List<CanonicalTreeParser> subTrees = new ArrayList<CanonicalTreeParser>();
while (!treeParser.eof()) {
FileMode entryFileMode = treeParser.getEntryFileMode();
if (FileMode.TREE.equals(entryFileMode)) {
CanonicalTreeParser canonicalTreeParser = new CanonicalTreeParser();
canonicalTreeParser.reset(objectReader,
treeParser.getEntryObjectId());
subTrees.add(canonicalTreeParser);
} else {
if (!filterPredicate.evaluate(treeParserEntry)) {
treeEntryWalk.walk(treeParserEntry);
}
}
treeParser.next();
}
for (CanonicalTreeParser subTreeParser : subTrees) {
processTreeParser(subTreeParser);
}
}
示例2: loadTree
import org.eclipse.jgit.treewalk.CanonicalTreeParser; //導入方法依賴的package包/類
@NotNull
public Iterable<GitTreeEntry> loadTree(@Nullable GitTreeEntry tree) throws IOException {
final GitObject<ObjectId> treeId = getTreeObject(tree);
// Loading tree.
if (treeId == null) {
return Collections.emptyList();
}
final List<GitTreeEntry> result = new ArrayList<>();
final Repository repo = treeId.getRepo();
final CanonicalTreeParser treeParser = new CanonicalTreeParser(GitRepository.emptyBytes, repo.newObjectReader(), treeId.getObject());
while (!treeParser.eof()) {
result.add(new GitTreeEntry(
treeParser.getEntryFileMode(),
new GitObject<>(repo, treeParser.getEntryObjectId()),
treeParser.getEntryPathString()
));
treeParser.next();
}
return result;
}
示例3: loadOriginalCommit
import org.eclipse.jgit.treewalk.CanonicalTreeParser; //導入方法依賴的package包/類
@Nullable
public static RevCommit loadOriginalCommit(@NotNull ObjectReader reader, @Nullable ObjectId cacheCommit) throws IOException {
final RevWalk revWalk = new RevWalk(reader);
if (cacheCommit != null) {
final RevCommit revCommit = revWalk.parseCommit(cacheCommit);
revWalk.parseTree(revCommit.getTree());
final CanonicalTreeParser treeParser = new CanonicalTreeParser(GitRepository.emptyBytes, reader, revCommit.getTree());
while (!treeParser.eof()) {
if (treeParser.getEntryPathString().equals(ENTRY_COMMIT_REF)) {
return revWalk.parseCommit(treeParser.getEntryObjectId());
}
treeParser.next();
}
}
return null;
}
示例4: useCanonicalTreeParser
import org.eclipse.jgit.treewalk.CanonicalTreeParser; //導入方法依賴的package包/類
private void useCanonicalTreeParser(ObjectId id) throws IOException {
CanonicalTreeParser treeParser = new CanonicalTreeParser();
RevTree tree = new RevWalk(repo).lookupTree(id);
treeParser.reset(repo.getObjectDatabase().newReader(), tree);
System.out.println("CanonicalTreeParser");
for (; !treeParser.eof(); treeParser = treeParser.next()) {
ObjectId newObjectId = treeParser.getEntryObjectId();
String entryPath = treeParser.getEntryPathString();
System.out.println(newObjectId + " entryPath=" + entryPath + " subTree=" + TREE.equals(treeParser
.getEntryFileMode()));
}
}
示例5: hasSingleTreeEntry
import org.eclipse.jgit.treewalk.CanonicalTreeParser; //導入方法依賴的package包/類
private boolean hasSingleTreeEntry(TreeWalk tw) throws IOException {
if (count != 1 || !FileMode.TREE.equals(tw.getRawMode(0))) {
return false;
}
CanonicalTreeParser p = new CanonicalTreeParser();
p.reset(tw.getObjectReader(), tw.getObjectId(0));
p.next();
return p.eof();
}
示例6: getOnlyChildSubtree
import org.eclipse.jgit.treewalk.CanonicalTreeParser; //導入方法依賴的package包/類
private CanonicalTreeParser getOnlyChildSubtree(RevWalk rw, ObjectId id, byte[] prefix)
throws IOException {
CanonicalTreeParser p = new CanonicalTreeParser(prefix, rw.getObjectReader(), id);
if (p.eof() || p.getEntryFileMode() != FileMode.TREE) {
return null;
}
p.next(1);
return p.eof() ? p : null;
}