summaryrefslogtreecommitdiff
path: root/git/objects/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2014-11-15 16:19:24 +0100
committerSebastian Thiel <byronimo@gmail.com>2014-11-15 16:21:37 +0100
commitff13922f6cfb11128b7651ddfcbbd5cad67e477f (patch)
tree9d999b14a7817b1ceeb23ddd1cded446ace9255c /git/objects/util.py
parent9c39afa1f85f3293ad2ccef684ff62bf0a36e73c (diff)
parentf7ed51ba4c8416888f5744ddb84726316c461051 (diff)
downloadgitpython-ff13922f6cfb11128b7651ddfcbbd5cad67e477f.tar.gz
Merge branch 'sf-master' of https://github.com/johnsca/GitPython into johnsca-sf-master
Conflicts: git/cmd.py git/objects/commit.py git/objects/fun.py git/objects/util.py git/remote.py git/repo/base.py git/test/lib/helper.py git/test/test_commit.py git/test/test_fun.py git/util.py
Diffstat (limited to 'git/objects/util.py')
-rw-r--r--git/objects/util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/git/objects/util.py b/git/objects/util.py
index 2e44c9c0..cdf72bed 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,10 +175,14 @@ 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))
-
#} END functions