Added parsing for '@1400000000 +0000' date format as used by git comm… · gitpython-developers/GitPython@f7cff58 · GitHub
Skip to content

Commit f7cff58

Browse files
dries007Byron
authored andcommitted
Added parsing for '@1400000000 +0000' date format as used by git commit hooks.
1 parent 313b3b4 commit f7cff58

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions

git/objects/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def parse_date(string_date):
148148
try:
149149
if string_date.count(' ') == 1 and string_date.rfind(':') == -1:
150150
timestamp, offset = string_date.split()
151+
if timestamp.startswith('@'):
152+
timestamp = timestamp[1:]
151153
timestamp = int(timestamp)
152154
return timestamp, utctz_to_altz(verify_utctz(offset))
153155
else:

git/test/test_repo.py

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)