]> source.dussan.org Git - jgit.git/commitdiff
Fix PersonIdent to always use SystemReader 83/183/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 6 Jan 2010 23:16:05 +0000 (15:16 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 12 Jan 2010 19:56:55 +0000 (11:56 -0800)
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

index 1c174aa03d69b5a5e93b77d08a519586d8a74268..49d727f8e1ffba685cab7dc95ba57f1d51b7971d 100644 (file)
@@ -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);
        }
 
        /**