public 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 RevCommit readCommit(@Nullable ObjectId id, DataInput in) throws IOException { final ObjectId treeId = readObjectId(in); final int nParents = readUnsignedVarInt(in); final Builder<ObjectId> parentListBuilder = ImmutableList.builder(); for (int i = 0; i < nParents; i++) { ObjectId parentId = readObjectId(in); parentListBuilder.add(parentId); } final RevPerson author = readRevPerson(in); final RevPerson committer = readRevPerson(in); final String message = in.readUTF(); final List<ObjectId> parents = parentListBuilder.build(); RevCommit commit; if (id == null) { commit = RevCommit.builder().build(treeId, parents, author, committer, message); } else { commit = RevObjectFactory.defaultInstance().createCommit(id, treeId, parents, author, committer, message); } return commit; }
public 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); RevTag tag; if (id == null) { tag = RevTagBuilder.create(ObjectId.NULL, name, commitId, message, tagger); id = new HashObject().setObject(tag).call(); } tag = RevTagBuilder.create(id, name, commitId, message, tagger); return tag; }
public RevCommit readCommit(@Nullable ObjectId id, DataInput in) throws IOException { final ObjectId treeId = readObjectId(in); final int nParents = readUnsignedVarInt(in); final Builder<ObjectId> parentListBuilder = ImmutableList.builder(); for (int i = 0; i < nParents; i++) { ObjectId parentId = readObjectId(in); parentListBuilder.add(parentId); } final RevPerson author = readRevPerson(in); final RevPerson committer = readRevPerson(in); final String message = in.readUTF(); ObjectId commitId = id; if (id == null) { commitId = ObjectId.NULL; } RevCommit commit = CommitBuilder.create(commitId, treeId, parentListBuilder.build(), author, committer, message); if (id == null) { commitId = new HashObject().setObject(commit).call(); commit = CommitBuilder.create(commitId, treeId, parentListBuilder.build(), author, committer, message); } return commit; }