diff options
author | Ivan Frade <ifrade@google.com> | 2024-11-20 13:09:24 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2024-11-20 13:09:24 -0800 |
commit | ee8a4149135284e2319cb5c64de8387a3334bcdd (patch) | |
tree | 7a3e09c487afb948963ae119279fc0011eeddaf4 /org.eclipse.jgit/src/org/eclipse | |
parent | f072d2ec7b1fe21d403c93f8c3dac7fc9e9e526a (diff) | |
download | jgit-ee8a4149135284e2319cb5c64de8387a3334bcdd.tar.gz jgit-ee8a4149135284e2319cb5c64de8387a3334bcdd.zip |
PersonIdent: Preserve the timezone when copying with new time
The PersonIdent(PersonIdent,Date) constructor must create a copy with
the same author/email/timezone but different time. When we changed
the implementation to the new Instant/ZoneId version, we forgot to
pass the timezone. This made fail some tests downstream.
Pass the timezone when constructing the copy.
Change-Id: Iaa979e6dbaa3c55d4c4d2040068ab8b03163cd4e
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java | 3 |
1 files changed, 2 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 600fec42ca..5d3db9e6ee 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java @@ -240,7 +240,8 @@ public class PersonIdent implements Serializable { */ @Deprecated(since = "7.1") public PersonIdent(PersonIdent pi, Date aWhen) { - this(pi.getName(), pi.getEmailAddress(), aWhen.toInstant()); + this(pi.getName(), pi.getEmailAddress(), aWhen.toInstant(), + pi.tzOffset); } /** |