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
h[:parents] = self.parents.collect do |p|
[p.id,0,0]
end
- h[:author] = author.name.force_encoding("UTF-8")
+ h[:author] = author.name
h[:time] = time
h[:space] = space
h[:refs] = refs.collect{|r|r.name}.join(" ") unless refs.nil?
h[:id] = sha
h[:date] = date
- h[:message] = message.force_encoding("UTF-8")
+ h[:message] = message
h[:login] = author.email
h
end