aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-01-06 15:16:05 -0800
committerShawn O. Pearce <spearce@spearce.org>2010-01-12 11:56:55 -0800
commit23cb7f9d5c1fa1c57cc59350ff16a9ecff527313 (patch)
tree9861ca85a363a7468ee54ad198ca4d59fd99ca67 /org.eclipse.jgit
parentde45869e1dc28fa99951709b9485a35dbcea4444 (diff)
downloadjgit-23cb7f9d5c1fa1c57cc59350ff16a9ecff527313.tar.gz
jgit-23cb7f9d5c1fa1c57cc59350ff16a9ecff527313.zip
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>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java5
1 files changed, 4 insertions, 1 deletions
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 1c174aa03d..49d727f8e1 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 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);
}
/**