Skip to content
Snippets Groups Projects
Commit 23cb7f9d authored by Shawn Pearce's avatar Shawn Pearce
Browse files

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: default avatarShawn O. Pearce <spearce@spearce.org>
parent de45869e
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,10 @@ public PersonIdent(final PersonIdent pi) {
* @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);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment