Paul Martin
2016-03-23 caa660d97f95e4da66c9f7722267145ffe8e6d48
src/main/java/com/gitblit/models/RepositoryCommit.java
@@ -17,15 +17,17 @@
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Date;
import java.util.List;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.revwalk.RevCommit;
/**
 * Model class to represent a RevCommit, it's source repository, and the branch.
 * This class is used by the activity page.
 *
 *
 * @author James Moger
 */
public class RepositoryCommit implements Serializable, Comparable<RepositoryCommit> {
@@ -54,6 +56,10 @@
      return refs;
   }
   public ObjectId getId() {
      return commit.getId();
   }
   public String getName() {
      return commit.getName();
   }
@@ -66,8 +72,16 @@
      return commit.getShortMessage();
   }
   public Date getCommitDate() {
      return new Date(commit.getCommitTime() * 1000L);
   }
   public int getParentCount() {
      return commit.getParentCount();
   }
   public RevCommit [] getParents() {
      return commit.getParents();
   }
   public PersonIdent getAuthorIdent() {
@@ -102,10 +116,14 @@
      }
      return 0;
   }
   public RepositoryCommit clone(String withRef) {
      return new RepositoryCommit(repository, withRef, commit);
   }
   @Override
   public String toString() {
      return MessageFormat.format("{0} {1} {2,date,yyyy-MM-dd HH:mm} {3} {4}",
      return MessageFormat.format("{0} {1} {2,date,yyyy-MM-dd HH:mm} {3} {4}",
            getShortName(), branch, getCommitterIdent().getWhen(), getAuthorIdent().getName(),
            getShortMessage());
   }