Newer
Older
GitBucket / src / main / scala / gitbucket / core / api / ApiPersonIdent.scala
@Tomofumi Tanaka Tomofumi Tanaka on 16 Mar 2015 567 bytes Move api package to new rule
package gitbucket.core.api

import gitbucket.core.util.JGitUtil.CommitInfo

import java.util.Date


case class ApiPersonIdent(
  name: String,
  email: String,
  date: Date)


object ApiPersonIdent {
  def author(commit: CommitInfo): ApiPersonIdent =
    ApiPersonIdent(
      name  = commit.authorName,
      email = commit.authorEmailAddress,
      date  = commit.authorTime)
  def committer(commit: CommitInfo): ApiPersonIdent =
    ApiPersonIdent(
      name  = commit.committerName,
      email = commit.committerEmailAddress,
      date  = commit.commitTime)
}