Newer
Older
gitbucket_jkp / src / main / scala / api / ApiPersonIdent.scala
@nazoking nazoking on 15 Mar 2015 534 bytes (api-support)change crlf
package api

import java.util.Date
import util.JGitUtil.CommitInfo

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)
}