diff options
author | Igor Bondarenko <jetmind2@gmail.com> | 2013-02-14 15:01:39 +0200 |
---|---|---|
committer | Igor Bondarenko <jetmind2@gmail.com> | 2013-02-14 15:36:20 +0200 |
commit | 007bd4b8190a6e85831c145e0aed5c68594db556 (patch) | |
tree | 9652a03555d2adde6c79c6660b190de5e42a95e3 /git | |
parent | 0e9eef45194039af6b8c22edf06cfd7cb106727a (diff) | |
download | gitpython-007bd4b8190a6e85831c145e0aed5c68594db556.tar.gz |
Fixed parse_actor_and_date with mangled tags
Diffstat (limited to 'git')
-rw-r--r-- | git/objects/util.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/git/objects/util.py b/git/objects/util.py index 4c9323b8..af46f3c6 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -167,6 +167,7 @@ def parse_date(string_date): # precompiled regex _re_actor_epoch = re.compile(r'^.+? (.*) (\d+) ([+-]\d+).*$') +_re_only_actor = re.compile(r'^.+? (.*)$') def parse_actor_and_date(line): """Parse out the actor (author or committer) info from a line like:: @@ -174,8 +175,13 @@ def parse_actor_and_date(line): author Tom Preston-Werner <tom@mojombo.com> 1191999972 -0700 :return: [Actor, int_seconds_since_epoch, int_timezone_offset]""" + actor, epoch, offset = '', 0, 0 m = _re_actor_epoch.search(line) - actor, epoch, offset = m.groups() + if m: + actor, epoch, offset = m.groups() + else: + m = _re_only_actor.search(line) + actor = m.group(1) if m else line or '' return (Actor._from_string(actor), int(epoch), utctz_to_altz(offset)) |