Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita8f7e37

Browse files
committed
fix(commit): serialization timezone handling
Previously timezones which were not divisable by 3600s would beparsed correctly, but would serialize into a full hour, rounded up.Now floating point computation is used which fixes the issue.Related to#336
1 parent039e265 commita8f7e37

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

‎doc/source/changes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog
33
=========
44

5+
1.0.2 - Fixes
6+
=============
7+
8+
* CRITICAL: fixed incorrect `Commit` object serialization when authored or commit date had timezones which were not
9+
divisable by 3600 seconds. This would happen if the timezone was something like `+0530` for instance.
10+
* A list of all additional fixes can be found `on github<https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v1.0.2+-+Fixes%22+is%3Aclosed>`_
11+
512
1.0.1 - Fixes
613
=============
714

‎git/objects/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def utctz_to_altz(utctz):
7373
defaltz_to_utctz_str(altz):
7474
"""As above, but inverses the operation, returning a string that can be used
7575
in commit objects"""
76-
utci=-1*int((altz/3600)*100)
76+
utci=-1*int((float(altz)/3600)*100)
7777
utcs=str(abs(utci))
7878
utcs="0"* (4-len(utcs))+utcs
7979
prefix= (utci<0and'-')or'+'

‎git/test/performance/test_commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_commit_iteration(self):
7676
% (nc,elapsed_time,nc/elapsed_time),file=sys.stderr)
7777

7878
deftest_commit_serialization(self):
79-
assert_commit_serialization(self.gitrwrepo,self.gitrwrepo.head,True)
79+
assert_commit_serialization(self.gitrwrepo,'58c78e6',True)
8080

8181
rwrepo=self.gitrwrepo
8282
make_object=rwrepo.odb.store

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp