fix graph problem if authorname or message isnot utf8 encoding
This commit is contained in:
parent
efd9a717c1
commit
c71a76e71a
2 changed files with 19 additions and 4 deletions
|
@ -14,8 +14,23 @@ Grit::Blob.class_eval do
|
|||
end
|
||||
|
||||
Grit::Commit.class_eval do
|
||||
def message
|
||||
Gitlab::Encode.utf8 @message
|
||||
def to_hash
|
||||
{
|
||||
'id' => id,
|
||||
'parents' => parents.map { |p| { 'id' => p.id } },
|
||||
'tree' => tree.id,
|
||||
'message' => Gitlab::Encode.utf8(message),
|
||||
'author' => {
|
||||
'name' => Gitlab::Encode.utf8(author.name),
|
||||
'email' => author.email
|
||||
},
|
||||
'committer' => {
|
||||
'name' => Gitlab::Encode.utf8(committer.name),
|
||||
'email' => committer.email
|
||||
},
|
||||
'authored_date' => authored_date.xmlschema,
|
||||
'committed_date' => committed_date.xmlschema,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue