public static RevTag readTag(ObjectId id, DataInput in) throws IOException { final ObjectId commitId = readObjectId(in); final String name = in.readUTF(); final String message = in.readUTF(); final RevPerson tagger = readRevPerson(in); return RevTagBuilder.create(id, name, commitId, message, tagger); }
public static RevTag readTag(@Nullable ObjectId id, DataInput in) throws IOException { final ObjectId commitId = readObjectId(in); final String name = in.readUTF(); final String message = in.readUTF(); final RevPerson tagger = readRevPerson(in); return RevTag.builder().build(id, name, commitId, message, tagger); }
public static RevCommit readCommit(ObjectId id, DataInput in) throws IOException { byte tag = in.readByte(); if (tag != COMMIT_TREE_REF) { throw new IllegalArgumentException("Commit should include a tree ref"); } final ObjectId treeId = ObjectId.readFrom(in); final Builder<ObjectId> parentListBuilder = ImmutableList.builder(); while (true) { tag = in.readByte(); if (tag != COMMIT_PARENT_REF) { break; } else { parentListBuilder.add(ObjectId.readFrom(in)); } } if (tag != COMMIT_AUTHOR_PREFIX) { throw new IllegalArgumentException( "Expected AUTHOR element following parent ids in commit"); } final RevPerson author = readRevPerson(in); tag = in.readByte(); if (tag != COMMIT_COMMITTER_PREFIX) { throw new IllegalArgumentException( "Expected COMMITTER element following author in commit"); } final RevPerson committer = readRevPerson(in); final String message = in.readUTF(); return RevObjectFactory.defaultInstance().createCommit(id, treeId, parentListBuilder.build(), author, committer, message); }
final RevPerson author = readRevPerson(in); final RevPerson committer = readRevPerson(in);