Skip to content
Snippets Groups Projects
Commit ce6ad4c0 authored by Hal Wine's avatar Hal Wine
Browse files

scrub bad timezone values before dulwich sees them

If dulwich is presented with a "sub minute" timezone offset, it throws
an exception (see tests/test-timezone.t). This patch rounds the timezone
down to the next minute before passing the value to dulwich.
parent a6b7ad53
No related branches found
No related tags found
No related merge requests found
......@@ -376,6 +376,12 @@
commit = Commit()
(time, timezone) = ctx.date()
# work around to bad timezone offets - dulwich does not handle
# sub minute based timezones. In the one known case, it was a
# manual edit that led to the unusual value. Based on that,
# there is no reason to round one way or the other, so do the
# simplest and round down.
timezone -= (timezone % 60)
commit.author = self.get_git_author(ctx)
commit.author_time = int(time)
commit.author_timezone = -timezone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment