瀏覽代碼

Fix PersonIdent to always use SystemReader

Under unit tests we want the when and timezone to come from the
MockSystemReader and be stable.  We did this for the default
constructor based on the Repository, but failed to do it for the
name,emailAddress variant of the constructor.

Change-Id: I608ac7cf01673729303395e19b379b38fef136b3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.7.0
Shawn O. Pearce 14 年之前
父節點
當前提交
23cb7f9d5c
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java

+ 4
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java 查看文件

@@ -99,7 +99,10 @@ public class PersonIdent {
* @param aEmailAddress
*/
public PersonIdent(final String aName, final String aEmailAddress) {
this(aName, aEmailAddress, new Date(), TimeZone.getDefault());
name = aName;
emailAddress = aEmailAddress;
when = SystemReader.getInstance().getCurrentTime();
tzOffset = SystemReader.getInstance().getTimezone(when);
}

/**

Loading…
取消
儲存