diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-08-17 22:32:15 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-08-17 22:33:02 +0200 |
commit | a8f7e3772f68c8e6350b9ff5ac981ba3223f2d43 (patch) | |
tree | ce01004c2f928cc71265e8a3b832c03bc111da11 /git/objects/util.py | |
parent | 039e265819cc6e5241907f1be30d2510bfa5ca6c (diff) | |
download | gitpython-a8f7e3772f68c8e6350b9ff5ac981ba3223f2d43.tar.gz |
fix(commit): serialization timezone handling
Previously timezones which were not divisable by 3600s would be
parsed correctly, but would serialize into a full hour, rounded up.
Now floating point computation is used which fixes the issue.
Related to #336
Diffstat (limited to 'git/objects/util.py')
-rw-r--r-- | git/objects/util.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git/objects/util.py b/git/objects/util.py index 567b1d5b..8fd92a0a 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -73,7 +73,7 @@ def utctz_to_altz(utctz): def altz_to_utctz_str(altz): """As above, but inverses the operation, returning a string that can be used in commit objects""" - utci = -1 * int((altz / 3600) * 100) + utci = -1 * int((float(altz) / 3600) * 100) utcs = str(abs(utci)) utcs = "0" * (4 - len(utcs)) + utcs prefix = (utci < 0 and '-') or '+' |