mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-11-05 02:55:40 +01:00
Fix parsing of custom committer
Other tools use the 'committer' extra field differently, so let's make the parsing more reliable and don't assume it's in a certain format. Reported-by: Kevin Cox <kevincox@kevincox.ca> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
@@ -461,8 +461,12 @@ def export_ref(repo, name, kind, head):
|
||||
|
||||
author = "%s %d %s" % (fixup_user(user), time, gittz(tz))
|
||||
if 'committer' in extra:
|
||||
user, time, tz = extra['committer'].rsplit(' ', 2)
|
||||
committer = "%s %s %s" % (user, time, gittz(int(tz)))
|
||||
try:
|
||||
cuser, ctime, ctz = extra['committer'].rsplit(' ', 2)
|
||||
committer = "%s %s %s" % (cuser, ctime, gittz(int(ctz)))
|
||||
except ValueError:
|
||||
cuser = extra['committer']
|
||||
committer = "%s %d %s" % (fixup_user(cuser), time, gittz(tz))
|
||||
else:
|
||||
committer = author
|
||||
|
||||
|
||||
Reference in New Issue
Block a user