14

RevCommit有一个getCommitTime()方法,但它返回一个int并且它没有作者时间。如何从 a 中获取作者和提交日期RevCommit

4

1 回答 1

27

像这样:

RevCommit commit = ...;

PersonIdent authorIdent = commit.getAuthorIdent();
Date authorDate = authorIdent.getWhen();
TimeZone authorTimeZone = authorIdent.getTimeZone();

PersonIdent committerIdent = commit.getCommitterIdent();
...

另请参阅API 文档

于 2012-09-26T20:30:53.453 回答