Use ObjectId[] instead of List for parents
[egit.git] / org.spearce.jgit / src / org / spearce / jgit / pgm / Log.java
blob73bf556280f18bb61a9646a920ad72902fdc5c70
1 package org.spearce.jgit.pgm;
3 import java.io.File;
4 import java.io.IOException;
5 import org.spearce.jgit.lib.Commit;
6 import org.spearce.jgit.lib.ObjectId;
7 import org.spearce.jgit.lib.Repository;
9 public class Log {
10 public static void main(String[] args) throws IOException {
11 Repository db = new Repository(new File(".git"));
12 Commit commit = db.mapCommit(args[0]);
13 System.out.println("commit " + commit.getCommitId());
14 System.out.println("tree " + commit.getTreeId());
15 ObjectId[] ps=commit.getParentIds();
16 for (int ci=0; ci<ps.length; ++ci) {
17 System.out.println("parent " + ps[ci]);
19 System.out.println("author " + commit.getAuthor());
20 System.out.println();
21 System.out.println(commit.getMessage());