From 23cb7f9d5c1fa1c57cc59350ff16a9ecff527313 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" <spearce@spearce.org> Date: Wed, 6 Jan 2010 15:16:05 -0800 Subject: [PATCH] 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> --- org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java index 1c174aa03..49d727f8e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java @@ -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); } /** -- GitLab