Handle unicode emails in git commits
This should probably never happen, but it has anyway, so assume the email field is a utf8 string. This should avoid crashing in case someone has a utf8 email, but may not be a complete solution to the case that an email is in a non-ascii, non-utf8 charset. Change-Id: I95ed91e5fdfe35b73550e1824e609a0b1d388b3a
This commit is contained in:
parent
4cdf87687d
commit
3e23dbad0f
@ -83,12 +83,14 @@ class CommitContext(object):
|
|||||||
commit.authored_date, commit.author_tz_offset)
|
commit.authored_date, commit.author_tz_offset)
|
||||||
commit_date = self.decorateGitTime(
|
commit_date = self.decorateGitTime(
|
||||||
commit.committed_date, commit.committer_tz_offset)
|
commit.committed_date, commit.committer_tz_offset)
|
||||||
return ["Parent: %s\n" % parentsha,
|
return [u"Parent: %s\n" % parentsha,
|
||||||
"Author: %s <%s>\n" % (author.name, author.email),
|
u"Author: %s <%s>\n" % (author.name,
|
||||||
"AuthorDate: %s\n" % author_date,
|
unicode(author.email, 'utf8')),
|
||||||
"Commit: %s <%s>\n" % (committer.name, committer.email),
|
u"AuthorDate: %s\n" % author_date,
|
||||||
"CommitDate: %s\n" % commit_date,
|
u"Commit: %s <%s>\n" % (committer.name,
|
||||||
"\n"] + commit.message.splitlines(True)
|
unicode(committer.email, 'utf')),
|
||||||
|
u"CommitDate: %s\n" % commit_date,
|
||||||
|
u"\n"] + commit.message.splitlines(True)
|
||||||
|
|
||||||
def __init__(self, old, new):
|
def __init__(self, old, new):
|
||||||
"""Create a CommitContext.
|
"""Create a CommitContext.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user