Skip to content
Browse files

Make negative time zones produce '-700', not '--700'

This fixes failing spec:
'Gitrb::Commit should be readable by git binary' FAILED
expected: "Date:   Mon Apr 20 00:00:00 2009 -0700\n",
     got: "Date:   Mon Apr 20 00:00:00 2009 +0000\n" (using ==)
     commit_spec.rb:45:in `block (3 levels) in <top (required)>'
  • Loading branch information...
1 parent 1d3796e commit c409985f0fe88993a76a0f3b46528b9cc9bf4eda @bronson bronson committed with minad
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/gitrb/user.rb
View
2 lib/gitrb/user.rb
@@ -7,7 +7,7 @@ def initialize(name, email, date = Time.now)
def dump
off = date.gmt_offset / 60
- '%s <%s> %d %s%02d%02d' % [name, email, date.to_i, off < 0 ? '-' : '+', off / 60, off % 60]
+ '%s <%s> %d %s%02d%02d' % [name, email, date.to_i, off < 0 ? '' : '+', off / 60, off % 60]
end
def self.parse(user)

1 comment on commit c409985

@bronson

Apparently git doesn't like -700 anymore, it requires -0700. I just didn't deal with dates enough to recognize that.

git/git@daae192

The result: gitrb commits by people who live in negative time zones are now fsck failures and break the repository.

The gitrb fix is easy, pull request coming up. Fixing the broken repos, though, that will get interesting.

Please sign in to comment.
Something went wrong with that request. Please try again.